Re: [gnome-db] GDate, GdaTimestamp && sqlite

2009/6/25 Massimo Cora' <maxcvs email it>
Hash: SHA1


say I've the following table on sqlite.

create table foo (analyse_time DATE);

and say that I populate its elements with

insert into foo values (datetime ('now', 'localtime'));

A select shows me this:

sqlite> select * from foo;
2009-06-25 01:00:21

But when I'm getting the GValue from the GdaDataModel I cannot use it as
a GdaTimestamp. The only GType detected is GDate, but I need the time too.

2 solutions:
* if you can, use the timestamp type instead of date in the table declaration: create table foo (analyse_time timestamp);
* specifically request that the GType for the "analyse_time" column must be GDA_TYPE_TIMESTAMP when running the SELECT statement, using gda_connection_statement_execute_select_full()



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