Re: [gnome-db] gda_data_model_import_new_mem() gives errors



On Nov 28, 2007 5:28 AM, Sumit Kumar Jain <sumitskj_20 yahoo com> wrote:
>
> Hi,
> I am trying to use gda_data_model_import_new_mem() and i am getting the
> following error
>
> (TestGDA:5755): GLib-GObject-WARNING **: IA__g_object_new_valist: object
> class `GdaDataModelImport' has no property named `data'
>
> The following the code snippet
>
> ------------------------------------------------------------------------------------------------------------------------
>
> int main()
> {
>         const gchar *string = "a,b,c,d,e,f";
>
>         GdaParameterList *paramlist;
>         GdaParameter *param;
>         GSList *list;
>
>         gda_init ("TestGDA", NULL, 0, NULL);
>
>         param = gda_parameter_new_string("SEPARATOR",",");
>         list = g_slist_append(NULL,param);
>
>         paramlist = gda_parameter_list_new(list);
>
>         GdaDataModel *model1 =
> gda_data_model_import_new_mem("a|b|c|d|e|f",TRUE,paramlist);
>
>           return 0;
>
> }
>
> -------------------------------------------------------------------------------------------------------------------
>
> I am not able to figure out as to why i am getting this error. Looking at
> the documentation, looks that i am using the function correctly. Any
> pointers as to reason of error. Any help !!!


This is a bug in Libgda for which a correction will be available in
SVN tonight (if I can). Here is attached a slightly modified version
of your code which prints the contents of the imported data model. It
returns:
> ./testbug
column_0 | column_1 | column_2 | column_3 | column_4 | column_5
---------+----------+----------+----------+----------+---------
a        | b        | c        | d        | e        | f
(1 row)

Regards,

Vivien
#include <libgda/libgda.h>

int main()
{
        const gchar *string = "a,b,c,d,e,f";

        GdaParameterList *paramlist;
        GdaParameter *param;
        GSList *list;

        gda_init ("TestGDA", NULL, 0, NULL);

        param = gda_parameter_new_string ("SEPARATOR",",");
        list = g_slist_append (NULL, param);

        paramlist = gda_parameter_list_new (list);

        GdaDataModel *model1 = gda_data_model_import_new_mem (string, TRUE, paramlist);


	GdaDataModel *wrapper;
	wrapper = gda_data_access_wrapper_new (model1);
	gda_data_model_dump (wrapper, stdout);

	return 0;
}




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]