Re: [gnome-db] gda_sql_parser_parse_string

Vivien Malerba <[email protected]>
Newsgroups gmane.comp.gnome.db
Message-ID <[email protected]>
On 27 April 2010 08:12, Piotr Pokora <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.