![]() |
![]() |
![]() |
Libgnomedb Reference Manual | ![]() |
---|---|---|---|---|
GnomeDbResultSetGnomeDbResultSet — Represents the data returned by the execution of a SELECT query as a GnomeDbDataModel |
GnomeDbResultSet; GType gnome_db_result_set_get_type (void); GObject* gnome_db_result_set_new (GnomeDbQuery *query, GnomeDbTarget *modif_target); #define gnome_db_result_set_get_nbtuples(x) #define gnome_db_result_set_get_nbcols (x) #define gnome_db_result_set_get_gdavalue(x,row,col) #define gnome_db_result_set_get_col_name(x,col) #define gnome_db_result_set_set_col_name(x,col,name) #define gnome_db_result_set_get_data_model(x) gboolean gnome_db_result_set_check_model (GnomeDbResultSet *rs, gint nbcols, ...); gboolean gnome_db_result_set_check_data_model (GdaDataModel *model, gint nbcols, ...); gchar* gnome_db_result_set_get_row_as_string (GdaDataModel *model, GnomeDbQuery *query, gint row, gchar *sep);
GnomeDbResultSet implements GnomeDbDataModel, GnomeDbEntity and GdaDataModel.
"init-query-replacements" gpointer : Read "query-delete" gpointer : Read "query-insert" gpointer : Read "query-select" gpointer : Read "query-update" gpointer : Read
This object encapsulates a GdaDataModel object which is the result of the execution of a SELECT GnomeDbQuery object. It implements the GnomeDbDataModel and re-implements the GdaDataModel interface to make it possible to write back modifications to the results of the SELECT query in the database.
Objects of this class are created by the GnomeDbServer object in return of the execution of a SELECT statement
(using the gnome_db_server_do_query_as_result_set()
function call).
GObject* gnome_db_result_set_new (GnomeDbQuery *query, GnomeDbTarget *modif_target);
Creates a new GnomeDbResultSet object which will contain the data extracted from the
query
SELECT query. If modif_target
is not NULL
, then the resulting data model will
have modifiable values for fields belonging to the entity represented by modif_target
.
Note: to actually have some data in the new GnomeDbResultSet object, the
gnome_db_data_model_refresh()
function will have to be called.
query : |
a GnomeDbQuery (a SELECT query) |
modif_target : |
the target representing the modified entity, or NULL
|
Returns : | the new object |
#define gnome_db_result_set_get_gdavalue(x,row,col)
x : |
|
row : |
|
col : |
#define gnome_db_result_set_set_col_name(x,col,name)
x : |
|
col : |
|
name : |
gboolean gnome_db_result_set_check_model (GnomeDbResultSet *rs, gint nbcols, ...);
Check the column types of a resultset.
rs : |
a GnomeDbResultSet object |
nbcols : |
the requested number of columns |
... : |
nbcols arguments of type GdaValueType or -1 (if any data type is accepted)
|
Returns : | TRUE if the resultset's columns match the provided data types and number |
gboolean gnome_db_result_set_check_data_model (GdaDataModel *model, gint nbcols, ...);
Check the column types of a GdaDataModel.
model : |
a GdaDataModel object |
nbcols : |
the minimum requested number of columns |
... : |
nbcols arguments of type GdaValueType or -1 (if any data type is accepted)
|
Returns : | TRUE if the data model's columns match the provided data types and number |
gchar* gnome_db_result_set_get_row_as_string (GdaDataModel *model, GnomeDbQuery *query, gint row, gchar *sep);
Creates a string representing, for the specified row
, the visible fields query
,
separated by sep
. query
is usually the query which has been used to create the
resultset.
model : |
a GdaDataModel object |
query : |
a GnomeDbQuery object |
row : |
|
sep : |
|
Returns : | a new string, or NULL if an error occured.
|
init-query-replacements
" property"init-query-replacements" gpointer : Read
translate from fields of the query used for construction to the fields of the GnomeDbResultset.
query-select
" property"query-select" gpointer : Read
the SELECT query which is run to fill the data model.