Re: [gnome-db] libgda cursor support
- From: "Vivien Malerba" <vmalerba gmail com>
- To: "Murray Cumming" <murrayc murrayc com>
- Cc: gnome-db-list <gnome-db-list gnome org>
- Subject: Re: [gnome-db] libgda cursor support
- Date: Wed, 26 Sep 2007 12:04:07 +0200
On 9/26/07, Murray Cumming <murrayc murrayc com> wrote:
> On Wed, 2007-09-26 at 10:29 +0200, Vivien Malerba wrote:
> > You can't use gda_data_model_get_value_at () when you are using a
> > cursor, that API call is for random access (I should make that clear
> > in the doc), here is my small correction:
> >
> > [...]
> > GdaDataModelIter *iter = gda_data_model_create_iter(model);
> >
> > /* fetch the GdaParameter in iter for the first column */
> > GdaParameter *param = GDA_PARAMETER (GDA_PARAMETER_LIST
> > (iter)->parameters->data);
> >
> > while(gda_data_model_iter_move_next(iter))
> > {
> > const int row = gda_data_model_iter_get_row(iter);
> > printf("row=%d\n", row);
> >
> > /*const GValue *value = gda_data_model_get_value_at(model, 0, row);*/
> > const GValue *value = gda_parameter_get_value (param);
>
> That's a really horrible API. How do we get a value for a different
> column?
The point was just to show how to do it, the correct API to do it is:
param = gda_parameter_list_find_param (iter, "col_name")
Vivien
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]