Do not be confused by the sample SQL statement. What I really wanted to do is 
return two different resultsets in one statement and wanted an API to handle 
the two resultsets. For example:

select * form table1;
select * from table2;

And I do not want to use big union.

By reading other replies I think it's actually not practical to do this.

> To: sqlite-users@sqlite.org
> From: itandet...@mvps.org
> Date: Sun, 25 Mar 2012 08:42:11 -0400
> Subject: Re: [sqlite] Handle multiple results using sqlite3_step
> 
> Neo Anderson <neo_in_mat...@msn.com> wrote:
> > Is it possible to handle multiple results using sqlite3_step or any other 
> > API calls?
> > 
> > I want to execute the following SQL in one statement and want to get the 
> > two resultsets.
> > 
> > select 1 a; select 2 b;
> 
> No. In SQLite, each sqlite3_stmt* handle represents one resultset. If you 
> want two separate resultsets, you need two separate statements.
> 
> For this particular example, you can produce one row with two columns instead:
> 
> select 1 a, 2 b;
> 
> or two rows with one column:
> 
> select 1 a union all select 2 a;
> 
> Why do you want two resultsets? What is the actual problem you are trying to 
> solve?
> -- 
> Igor Tandetnik
> 
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
                                          
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to