Re: [gnome-db] gda_sql_parser_parse_string



On 27 April 2010 08:12, Piotr Pokora <piotrek pokora gmail com> wrote:
> Hi!
>
> I wonder, how can I force GDA to select field using particular type?
> e.g. SELECT col_a FROM tbl WHERE col_a=''.
> I can use parameter ##col_a::string for WHERE part, but how can I do
> this for SELECT part?

You can't (this might be possible in the future for example by parsing
a ::<type> syntax as in "SELECT col_a::int FROM tbl", as PostgreSQL
does). However you can request a specific type when executing the
statement using gda_connection_statement_execute_select_full() where
the @col_types argument is an array of requested GType for each column
of the returned GdaDataModel. See
http://library.gnome.org/devel/libgda/stable/GdaConnection.html#gda-connection-statement-execute-select-full

Regards,

Vivien


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