GNOME Data Access manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
struct GdaSelectPrivate; GdaDataModel* gda_select_new (void); void gda_select_add_source (GdaSelect *sel, const gchar *name, const GdaDataModel *source); void gda_select_set_sql (GdaSelect *sel, const gchar *sql); gboolean gda_select_run (GdaSelect *sel); |
GdaDataModel* gda_select_new (void); |
Create 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, const GdaDataModel *source); |
Add 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.
void gda_select_set_sql (GdaSelect *sel, const gchar *sql); |
Set 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); |
Run the query and fill 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.