Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes
mozISqlResultEnumerator Interface Reference

This interface is used to get the results from an SQL query. More...

import "mozISqlResultEnumerator.idl";

Inheritance diagram for mozISqlResultEnumerator:
Inheritance graph
[legend]
Collaboration diagram for mozISqlResultEnumerator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

boolean next ()
 Moves the row pointer to the next row in the results.
boolean previous ()
 Moves the row pointer to the previous row in the results.
void beforeFirst ()
 Moves the row pointer to just before the first row.
void first ()
 Moves the row pointer to the first row.
void last ()
 Moves the row pointer to the last row.
void relative (in long aRows)
 Moves the row pointer by a number relative to the current row.
void absolute (in long aRowIndex)
 Moves the row pointer to a specific row.
boolean isNull (in long aColumnIndex)
 Returns true if the value at the specified column in the current row is null.
nsIVariant getVariant (in long aColumnIndex)
 Returns the value at the specified column in the current row as a variant.
AString getString (in long aColumnIndex)
 Returns the value at the specified column in the current row as a string.
long getInt (in long aColumnIndex)
 Returns the value at the specified column in the current row as an integer.
float getFloat (in long aColumnIndex)
 Returns the value at the specified column in the current row as a float.
float getDecimal (in long aColumnIndex)
 Returns the value at the specified column in the current row as a decimal.
long long getDate (in long aColumnIndex)
 Returns the value at the specified column in the current row as a date.
boolean getBool (in long aColumnIndex)
 Returns the value at the specified column in the current row as a boolean.
void setNull (in long aColumnIndex)
 Sets the value at the specified column in the current row to null.
void setDefault (in long aColumnIndex)
 Sets the value at the specified column in the current row to the default value for that column.
void copy (in long aColumnIndex)
 Sets the value at the specified column in the current row to its original value.
void setVariant (in long aColumnIndex, in nsIVariant aValue)
 Sets the value at the specified column in the current row to a variant.
void setString (in long aColumnIndex, in AString aValue)
 Sets the value at the specified column in the current row to a string.
void setInt (in long aColumnIndex, in long aValue)
 Sets the value at the specified column in the current row to an integer.
void setFloat (in long aColumnIndex, in float aValue)
 Sets the value at the specified column in the current row to a float.
void setDecimal (in long aColumnIndex, in float aValue)
 Sets the value at the specified column in the current row to a decimal.
void setDate (in long aColumnIndex, in long long aValue)
 Sets the value at the specified column in the current row to a date.
void setBool (in long aColumnIndex, in boolean aValue)
 Sets the value at the specified column in the current row to a boolean.
void setNullValues ()
 Sets the value of the cells in all columns in the current row to null.
void setDefaultValues ()
 Sets the value of the cells in all columns in the current row to the default values for the columns.
void copyValues ()
 Sets the values of all of the cells in the current row to their original values.
boolean canInsert ()
 Returns true if inserts are allowed.
boolean canUpdate ()
 Returns true if updates are allowed.
boolean canDelete ()
 Returns true if deletes are allowed.
long insertRow ()
 Inserts a row using the data assigned using the various setX methods.
long updateRow ()
 Updates the current row using the data assigned using the various setX methods.
long deleteRow ()
 Deletes the current row.

Public Attributes

readonly attribute AString errorMessage
 The most recent error message.
readonly attribute AString currentCondition
 Holds the SQL condition clause.

Detailed Description

This interface is used to get the results from an SQL query.

The enumerator uses a row pointer which can be adjusted with the next and previous methods. Other methods operate only on the row selected by the pointer.

The row pointer starts just before the first row, so you should always call the next method once before attempting to read row data.

UNDER_DEVELOPMENT

Definition at line 55 of file mozISqlResultEnumerator.idl.


Member Function Documentation

Moves the row pointer to a specific row.

An error occurs if the index is after the last row.

Parameters:
aRowIndexthe index of the row to move to

Moves the row pointer to just before the first row.

Returns true if deletes are allowed.

Returns:
true if deletes are allowed

Returns true if inserts are allowed.

Returns:
true if inserts are allowed

Returns true if updates are allowed.

Returns:
true if updates are allowed

Sets the value at the specified column in the current row to its original value.

The row may be changed with the various setX methods and then commited with updateRow.

Parameters:
aColumnIndexthe column to modify

Sets the values of all of the cells in the current row to their original values.

The row may be changed with the various set methods and then commited with updateRow. This method is equivalent to calling the copy method for each column.

Deletes the current row.

Returns:
1 if the row was deleted or -1 if an error occured.

Moves the row pointer to the first row.

Returns the value at the specified column in the current row as a boolean.

An error occurs if the value is not a boolean type.

Parameters:
aColumnIndexthe column to retrieve
Returns:
the boolean value

Returns the value at the specified column in the current row as a date.

An error occurs if the value is not a date type.

Parameters:
aColumnIndexthe column to retrieve
Returns:
the date value
float mozISqlResultEnumerator::getDecimal ( in long  aColumnIndex)

Returns the value at the specified column in the current row as a decimal.

An error occurs if the value is not a decimal type.

Parameters:
aColumnIndexthe column to retrieve
Returns:
the decimal value
float mozISqlResultEnumerator::getFloat ( in long  aColumnIndex)

Returns the value at the specified column in the current row as a float.

An error occurs if the value is not a float type.

Parameters:
aColumnIndexthe column to retrieve
Returns:
the float value

Returns the value at the specified column in the current row as an integer.

An error occurs if the value is not a integer type.

Parameters:
aColumnIndexthe column to retrieve
Returns:
the integer value
AString mozISqlResultEnumerator::getString ( in long  aColumnIndex)

Returns the value at the specified column in the current row as a string.

An error occurs if the value is not a string type.

Parameters:
aColumnIndexthe column to retrieve
Returns:
the string value

Returns the value at the specified column in the current row as a variant.

Parameters:
aColumnIndexthe column to retrieve
Returns:
the value as a variant

Inserts a row using the data assigned using the various setX methods.

The row was inserted successfully if 0 or 1 is returned, however if 0 is returned, the row does not satisfy the where condition of the result (that is, it doesn't belong in the result enumerator) and does not need to be displayed.

Returns:
1 if the row was inserted, 0 if the row was inserted but does not fit the condition, or -1 if an error occured.

Returns true if the value at the specified column in the current row is null.

Parameters:
aColumnIndexthe column to retrieve
Returns:
true if the value is null

Moves the row pointer to the last row.

Moves the row pointer to the next row in the results.

Returns true if there is a next row and false if there are no more rows.

Returns:
false if there are no more rows

Moves the row pointer to the previous row in the results.

Returns true if there is a previous row.

Returns:
false if there are no previous rows

Moves the row pointer by a number relative to the current row.

An error occurs if this causes the row pointer to extend past the last row. This method may also be used to move the row pointer back by using a negative value.

Parameters:
aRowIndexaRowIndex the number of rows to move by
void mozISqlResultEnumerator::setBool ( in long  aColumnIndex,
in boolean  aValue 
)

Sets the value at the specified column in the current row to a boolean.

Changes are not committed until either the insertRow or updateRow method is called.

Parameters:
aColumnIndexthe column to modify
aValuethe value to assign
void mozISqlResultEnumerator::setDate ( in long  aColumnIndex,
in long long  aValue 
)

Sets the value at the specified column in the current row to a date.

Changes are not committed until either the insertRow or updateRow method is called.

Parameters:
aColumnIndexthe column to modify
aValuethe value to assign
void mozISqlResultEnumerator::setDecimal ( in long  aColumnIndex,
in float  aValue 
)

Sets the value at the specified column in the current row to a decimal.

Changes are not committed until either the insertRow or updateRow method is called.

Parameters:
aColumnIndexthe column to modify
aValuethe value to assign

Sets the value at the specified column in the current row to the default value for that column.

Changes are not committed until either the insertRow or updateRow method is called.

Parameters:
aColumnIndexthe column to modify

Sets the value of the cells in all columns in the current row to the default values for the columns.

This is equivalent to calling setDefaultValue for every column.

void mozISqlResultEnumerator::setFloat ( in long  aColumnIndex,
in float  aValue 
)

Sets the value at the specified column in the current row to a float.

Changes are not committed until either the insertRow or updateRow method is called.

Parameters:
aColumnIndexthe column to modify
aValuethe value to assign
void mozISqlResultEnumerator::setInt ( in long  aColumnIndex,
in long  aValue 
)

Sets the value at the specified column in the current row to an integer.

Changes are not committed until either the insertRow or updateRow method is called.

Parameters:
aColumnIndexthe column to modify
aValuethe value to assign

Sets the value at the specified column in the current row to null.

Changes are not committed until either the insertRow or updateRow method is called.

Parameters:
aColumnIndexthe column to modify

Sets the value of the cells in all columns in the current row to null.

This is equivalent to calling setNullValue for every column.

void mozISqlResultEnumerator::setString ( in long  aColumnIndex,
in AString  aValue 
)

Sets the value at the specified column in the current row to a string.

Changes are not committed until either the insertRow or updateRow method is called.

Parameters:
aColumnIndexthe column to modify
aValuethe value to assign
void mozISqlResultEnumerator::setVariant ( in long  aColumnIndex,
in nsIVariant  aValue 
)

Sets the value at the specified column in the current row to a variant.

Changes are not committed until either the insertRow or updateRow method is called.

Parameters:
aColumnIndexthe column to modify
aValuethe value to assign

Updates the current row using the data assigned using the various setX methods.

The row was inserted successfully if 0 or 1 is returned, however if 0 is returned, the row does not satisfy the where condition of the result and does not need to be displayed.

Returns:
1 if the row was updated, 0 if the row was updated but does not fit the condition, or -1 if an error occured.

Member Data Documentation

Holds the SQL condition clause.

Definition at line 361 of file mozISqlResultEnumerator.idl.

The most recent error message.

Definition at line 60 of file mozISqlResultEnumerator.idl.


The documentation for this interface was generated from the following file: