gda-recordset

Name

gda-recordset — one line description goes here.

Synopsis



#define     GDA_RECORDSET_INVALID_POSITION
Gda_Recordset* gda_recordset_new            (void);
void        gda_recordset_free              (Gda_Recordset *rs);
GDA_Field*  gda_recordset_field_name        (Gda_Recordset *rs,
                                             gchar *name);
GDA_Field*  gda_recordset_field_idx         (Gda_Recordset *rs,
                                             gint idx);
gint        gda_recordset_bof               (Gda_Recordset *rs);
gint        gda_recordset_eof               (Gda_Recordset *rs);
gulong      gda_recordset_move              (Gda_Recordset *rs,
                                             gint count,
                                             gpointer bookmark);
gulong      gda_recordset_move_first        (Gda_Recordset *rs);
gulong      gda_recordset_move_last         (Gda_Recordset *rs);
gulong      gda_recordset_move_next         (Gda_Recordset *rs);
gulong      gda_recordset_move_prev         (Gda_Recordset *rs);
gint        gda_recordset_rowsize           (Gda_Recordset *rs);

Description

Details


GDA_RECORDSET_INVALID_POSITION

#define GDA_RECORDSET_INVALID_POSITION 0xffffffff


gda_recordset_new()

Gda_Recordset* gda_recordset_new            (void);

Allocates space for a new recordset.

Returns : the allocated recordset object


gda_recordset_free()

void        gda_recordset_free              (Gda_Recordset *rs);

This function frees all memory allocated by the recordset and destroys all associations with commands and connections.

rs : the recoedset which should be destroyed.


gda_recordset_field_name()

GDA_Field*  gda_recordset_field_name        (Gda_Recordset *rs,
                                             gchar *name);

rs : 
name : 
Returns : 


gda_recordset_field_idx()

GDA_Field*  gda_recordset_field_idx         (Gda_Recordset *rs,
                                             gint idx);

Returns a pointer to the field at position idx of the current row of the recordset.

rs : the recordset
idx : the index of the field in the current row
Returns : a pointer to a field structor or NULL if idx is out of range


gda_recordset_bof()

gint        gda_recordset_bof               (Gda_Recordset *rs);

This function is used to check if the recordset cursor is beyond the first row. If this function returns TRUE any of the functions which actually returns the value of a field an error is returned because the cursor doesn't point to a row.

rs : Recordset which should be checked
Returns : 1 if the cursor is beyond the first record or the recordset is empty, 0 otherwise.


gda_recordset_eof()

gint        gda_recordset_eof               (Gda_Recordset *rs);

This function is used to check if the recordset cursor is after the last row. If this function returns TRUE any of the functions which actually returns the value of a field an error is returned because the cursor doesn't point to a row.

rs : Recordset which should be checked
Returns : 1 if the cursor is after the last record or the recordset is empty, 0 otherwise.


gda_recordset_move()

gulong      gda_recordset_move              (Gda_Recordset *rs,
                                             gint count,
                                             gpointer bookmark);

Moves the cursor of the recordset forward or backward. count is the number of records to move. If count is negative the cursor is moved towards the beginning. The function causes the recordset to actually fetch records from the data source. Each fetch from the data source fetches cachesize rows in one turn. A maximum of maxrows rows can be fetched.

If the cursor is on the second row and the count parameter is -10, then the cursor is position in front of the first record available. gda_rcordset_bof() will return TRUE and the return value of the function is two, because the cursor actually moved two records.

rs : the recordset
count : The number of records to skip
bookmark : if not NULL, the cursor is positioned relative to the record described by this paramter. seee gda_recordset_get_bookmark() how to get bookmark values for records.
Returns : the number of the record the cursor is addressing after the move or GDA_RECORDSET_INVALID_POSITION if there was an error fetching the rows.


gda_recordset_move_first()

gulong      gda_recordset_move_first        (Gda_Recordset *rs);

Moves the cursor of the recordset to the first record.

If the cursor is already on the the fist record nothing happen.

rs : the recordset
Returns : the position of the cursor, or GDA_RECORDSET_INVALID_POSITION if there was an error.


gda_recordset_move_last()

gulong      gda_recordset_move_last         (Gda_Recordset *rs);

Moves the cursor of the recordset to the first record.

If the cursor is already on the the fist record nothing happen.

rs : the recordset
Returns : the position of the cursor, or GDA_RECORDSET_INVALID_POSITION if there was an error.


gda_recordset_move_next()

gulong      gda_recordset_move_next         (Gda_Recordset *rs);

rs : 
Returns : 


gda_recordset_move_prev()

gulong      gda_recordset_move_prev         (Gda_Recordset *rs);

rs : 
Returns : 


gda_recordset_rowsize()

gint        gda_recordset_rowsize           (Gda_Recordset *rs);

rs: the recordset

Returns the number of field in a row of the current recordset

rs : 
Returns : the number of rows in the recordset or 0 if there was an error.