Top | ![]() |
![]() |
![]() |
![]() |
GdaSelectGdaSelect — Filtering data from GdaDataModel |
GdaDataModel * | gda_select_new () |
void | gda_select_add_source () |
void | gda_select_set_sql () |
gboolean | gda_select_run () |
GdaDataModel *
gda_select_new (void
);
Creates a new GdaSelect object, which allows programs to filter GdaDataModel's based on a given SQL SELECT command.
A GdaSelect is just another GdaDataModel-based class, so it can be used in the same way any other data model class is.
void gda_select_add_source (GdaSelect *sel
,const gchar *name
,GdaDataModel *source
);
Adds a data model as a source of data for the GdaSelect object. When the select object is run (via gda_select_run), it will parse the SQL and get the required data from the source data models.
sel |
a GdaSelect object. |
|
name |
name to identify the data model (usually a table name). |
|
source |
a GdaDataModel from which to get data. |
void gda_select_set_sql (GdaSelect *sel
,const gchar *sql
);
Sets the SQL command to be used on the given GdaSelect object for filtering rows from the source data model (which is set with gda_select_set_source).
gboolean
gda_select_run (GdaSelect *sel
);
Runs the query and fills in the GdaSelect object with the rows that matched the SQL command (which can be set with gda_select_set_sql) associated with this GdaSelect object.
After calling this function, if everything is successful, the GdaSelect object will contain the matched rows, which can then be accessed like a normal GdaDataModel.