Re: [gnome-db] Prepared statements with libgda



On 3/23/07, Massimo Corà <maxcvs email it> wrote:
Hi guys,

I've a problem with libgda queries and I cannot find any suitable
example that can explain me why these simple prepared statements don't
work. I hope you will do.

Well, suppose I have the following SQLite table:

CREATE TABLE workspace (workspace_id integer PRIMARY KEY AUTOINCREMENT,
name varchar (50) not null unique,
analize_time DATE
);

I successfully created a connection to the database, then I want to add
a row into this table:

GdaDict *dict;
GdaQuery *query;

dict = gda_dict_new ();
gda_dict_set_connection (dict, db_connection);
gda_dict_load (dict, NULL);

query = gda_query_new_from_sql (dict,
"INSERT INTO workspace (analize_time, name) VALUES (datetime('now'),
##/* name:'+0' type:'gchararray' */)", NULL);


it seems all ok but I got this error on runtime

GdaHandlerTime 0x8052800
locale order = Month Day Year, separator = /
locale has 2 digits year, using 2000 as offset

** ERROR **: file gda-query-parsing.c: line 1647
(parsed_create_value_query_field): assertion failed: (gdatype !=
G_TYPE_INVALID)


Note: if I create that query without 'analize_time' and the
"datetime('now')" part, I got the query committed in the database, after
parameter setting of course..
What's going wrong?

I guess there is a bug in the gda-query-parsing.c file or in the
SQLite provider. Would it be possible for you to send me a complete
sample (source file + dictionary file) so I can reproduce the problem
here?

Regards,

Vivien



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