![]() | ![]() | ![]() | Libmergeant Reference Manual | ![]() |
---|
#define MG_RESULTSET_TYPE #define MG_RESULTSET (obj) #define MG_RESULTSET_CLASS (klass) #define IS_MG_RESULTSET (obj) struct MgResultSet; guint mg_resultset_get_type (void); GObject* mg_resultset_new (MgServer *srv, GdaCommand *cmd, GdaDataModel *model); gint mg_resultset_get_nbtuples (MgResultSet *rs); gint mg_resultset_get_nbcols (MgResultSet *rs); gchar* mg_resultset_get_item (MgResultSet *rs, gint row, gint col); const GdaValue* mg_resultset_get_gdavalue (MgResultSet *rs, gint row, gint col); const gchar* mg_resultset_get_col_name (MgResultSet *rs, gint col); void mg_resultset_set_col_name (MgResultSet *rs, gint col, const gchar *name); GdaDataModel* mg_resultset_get_data_model (MgResultSet *rs); gboolean mg_resultset_check_model (MgResultSet *rs, gint nbcols, ...); gboolean mg_resultset_check_data_model (GdaDataModel *model, gint nbcols, ...);
Objects of this class are created by the MgServer object in return of the execution of a SELECT statement (using the mg_server_do_query() function call). Acces to individual data is done through this object.
#define MG_RESULTSET(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, mg_resultset_get_type(), MgResultSet)
obj : |
|
#define MG_RESULTSET_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, mg_resultset_get_type (), MgResultSetClass)
klass : |
|
#define IS_MG_RESULTSET(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, mg_resultset_get_type ())
obj : |
|
GObject* mg_resultset_new (MgServer *srv, GdaCommand *cmd, GdaDataModel *model);
Creates a new MgResultSet object
srv : | a MgServer object |
cmd : | the GdaCommand which returned a result (stored in model) |
model : | the GdaDataModel result |
Returns : | the new object |
gint mg_resultset_get_nbtuples (MgResultSet *rs);
Fetch the number of tuples (rows) in the resultset
rs : | a MgResultSet object |
Returns : | the number of tuples |
gint mg_resultset_get_nbcols (MgResultSet *rs);
Fetch the number of columns of a resultset
rs : | a MgResultSet object |
Returns : | the number of columns |
gchar* mg_resultset_get_item (MgResultSet *rs, gint row, gint col);
Get a textual version of an item in the resultset, situated at (row, col).
rs : | a MgResultSet object |
row : |
|
col : |
|
Returns : | a new string. |
const GdaValue* mg_resultset_get_gdavalue (MgResultSet *rs, gint row, gint col);
Get an item in the resultset, situated at (row, col) as a GdaValue.
rs : | a MgResultSet object |
row : |
|
col : |
|
Returns : | the item as a GdaValue |
const gchar* mg_resultset_get_col_name (MgResultSet *rs, gint col);
Get a column name from a resultset.
rs : | a MgResultSet object |
col : |
|
Returns : | the column's name |
void mg_resultset_set_col_name (MgResultSet *rs, gint col, const gchar *name);
Set a resultset's column's name
rs : | a MgResultSet object |
col : |
|
name : |
GdaDataModel* mg_resultset_get_data_model (MgResultSet *rs);
Get rs's associated GdaDataModel
rs : | a MgResultSet object |
Returns : | the GdaDataModel |
gboolean mg_resultset_check_model (MgResultSet *rs, gint nbcols, ...);
Check the column types of a resultset.
rs : | a MgResultSet 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 mg_resultset_check_data_model (GdaDataModel *model, gint nbcols, ...);
Check the column types of a GdaDataModel.
model : | a GdaDataModel object |
nbcols : | the 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 |
void user_function (MgResultSet *mgresultset, gpointer user_data);
mgresultset : | the object which received the signal. |
user_data : | user data set when the signal handler was connected. |
<<< MgServer | MgServerDataType >>> |