![]() |
![]() |
![]() |
GNOME Data Access 3.0 manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces |
GdaDataModelFilterSQLGdaDataModelFilterSQL — Filtering data from one or several GdaDataModel objects |
struct GdaDataModelFilterSQL; GdaDataModel * gda_data_model_filter_sql_new (void
); void gda_data_model_filter_sql_add_source (GdaDataModelFilterSQL *sel
,const gchar *name
,GdaDataModel *source
); void gda_data_model_filter_sql_set_sql (GdaDataModelFilterSQL *sel
,const gchar *sql
); gboolean gda_data_model_filter_sql_run (GdaDataModelFilterSQL *sel
);
GObject +----GdaObject +----GdaDataModelRow +----GdaDataModelArray +----GdaDataModelFilterSQL
The GdaDataModelFilterSQL object implements simple SQL "SELECT" queries accessing data stored in various GdaDataModel objects which it is instructed to use.
GdaDataModel * gda_data_model_filter_sql_new (void
);
Creates a new GdaDataModelFilterSQL object, which allows programs to filter GdaDataModel's based on a given SQL SELECT command.
A GdaDataModelFilterSQL is just another GdaDataModel-based class, so it can be used in the same way any other data model class is.
Returns : |
the newly created object. |
void gda_data_model_filter_sql_add_source (GdaDataModelFilterSQL *sel
,const gchar *name
,GdaDataModel *source
);
Adds a data model as a source of data for the GdaDataModelFilterSQL object. When the select object is run (via gda_data_model_filter_sql_run), it will parse the SQL and get the required data from the source data models.
|
a GdaDataModelFilterSQL object. |
|
name to identify the data model (usually a table name). |
|
a GdaDataModel from which to get data. |
void gda_data_model_filter_sql_set_sql (GdaDataModelFilterSQL *sel
,const gchar *sql
);
Sets the SQL command to be used on the given GdaDataModelFilterSQL object for filtering rows from the source data model (which is set with gda_data_model_filter_sql_set_source).
|
a GdaDataModelFilterSQL object. |
|
the SQL command to be used for filtering rows. |
gboolean gda_data_model_filter_sql_run (GdaDataModelFilterSQL *sel
);
Runs the query and fills in the GdaDataModelFilterSQL object with the rows that matched the SQL command (which can be set with gda_data_model_filter_sql_set_sql) associated with this GdaDataModelFilterSQL object.
After calling this function, if everything is successful, the GdaDataModelFilterSQL object will contain the matched rows, which can then be accessed like a normal GdaDataModel.
|
a GdaDataModelFilterSQL object. |
Returns : |
TRUE if successful, FALSE if there was an error. |