On 2 Feb 2012, at 2:03pm, Jorge Eliécer Osorio Caro wrote:
> im trying to return many data in sql extension i have a function that
> return structure that have a name and age of many users. but i just can
> return text o int, but i dont know how to return a structure like a table.
>
> struct data {
> char *name;
> int age;
> };
You will have to write your own routine to execute the SELECT statement,
retrieve the results using a routine on this page:
http://www.sqlite.org/c3ref/column_blob.html
, then put each value into the correct part of your structure.
Similarly, if you want to save the contents of your structure in a SQL database
you need to write a result that reads each value from your structure and makes
up a SQL statement or binds each value to a parameter using
http://www.sqlite.org/c3ref/bind_blob.html
Simon.
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users