[gnome-db] GdaSqlQuery: sub-queries

Murray Cumming <[email protected]>
Newsgroups gmane.comp.gnome.db
Message-ID <1273659905.5534.1547.camel@murrayc-desktop>
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
 
I tried passing the result of gda_sql_builder_compound_add_sub_select(),
but I think that's for something else. It resulted in a failed
G_VALUE_HOLDS_STRING() check.

-- 
[email protected]
www.murrayc.com
www.openismus.com
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.