Re: [gnome-db] GdaSqlQuery: sub-queries

Vivien Malerba <[email protected]>
Newsgroups gmane.comp.gnome.db
Message-ID <[email protected]>
On 12 May 2010 12:36, Vivien Malerba <[email protected]> wrote:
> On 12 May 2010 12:25, Murray Cumming <[email protected]> wrote:
>> In Glom I have a generic function like so:
>> int count_rows_returned_by(const std::string& sql_query)
>> {
>>  std::string query_count =
>>    "SELECT COUNT (*) FROM ("
>>    + sql_query
>>    + ") AS glomarbitraryalias";
>>  ...
>> }
>>
>> So with GdaSqlBuilder, is there any way to use a sub-query as the
>> target? gda_sql_builder_select_add_target_id() seems to be only for
>> specifying tables as targets:
>> http://library.gnome.org/devel/libgda/unstable/GdaSqlBuilder.html#gda-sql-builder-select-add-target-id
>>
>

It's possible using gda_sql_builder_select_add_target_id() with a
minor correction I've made,
see http://git.gnome.org/browse/libgda/commit/?id=9b8778a08ffad208d8da159643b38d0f61482c6b

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.