Hi Jay,

Thanks its make to me a major panorama, so i need to create a virtual table
in orde to add that result, that means that the user need to do 2 querys
ones to execute my function and other to view that result?

i see in spatialite extension do you know about it? that he has a virtual
table that make a select and that return a structure in the same query:

*SELECT *
FROM Roads_net
WHERE NodeFrom = 1 AND NodeTo = 512;*

that make and special query into virtual table that take like param
node_fromm node_to and return many data values like:

ArcRowid NodeFrom NodeTo Cost Geometry
NULL 1 512 22021.995764 BLOB sz=3376 GEOMETRY
1 1 4 3366.262555 NULL
11 4 16 1418.458904 NULT
15 16 20 868.499405 NULL
21 20 25 623.616463 NULL
22 25 24 186.070230 NULL


http://www.gaia-gis.it/spatialite-2.3.0/spatialite-network-2.3.0.html

Thanks.

2012/2/2 Jay A. Kreibich <[email protected]>

> On Thu, Feb 02, 2012 at 09:03:34AM -0500, Jorge Eli?cer Osorio Caro
> scratched on the wall:
>
> > 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.
>
>
>  You can't.  SQLite functions only deal with scalar values, as
>  functions are designed to be used inline with queries.  What you're
>  speaking of is more like a stored procedure, which SQLite does not
>  support.
>
>  You may be able to use a View, however, or even a Virtual Table, if
>  your query is very complex.
>
>   -j
>
>
>
> > El 1 de febrero de 2012 13:48, Jorge Eli?cer Osorio Caro <
> > [email protected]> escribi?:
> >
> > > Hi everyone i hope that you are ok.
> > >
> > > so im doing a sqlite extension that generate many data, i have a
> structure
> > > something like that:
> > >
> > > struct data {
> > > char *name;
> > > int age;
> > > };
> > >
> > > in the precess y create a listo of data:
> > >
> > > data *t = malloc(5 * sizeof(data))
> > >
> > > i need to return that values in order that the user can fetch like a
> > > table. using something like
> > > sqlite3_result_value i dont know how to do that.
> > >
> > > Help.
> > >
> > > Thanks.
> > >
> > _______________________________________________
> > sqlite-users mailing list
> > [email protected]
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
> --
> Jay A. Kreibich < J A Y  @  K R E I B I.C H >
>
> "Intelligence is like underwear: it is important that you have it,
>  but showing it to the wrong people has the tendency to make them
>  feel uncomfortable." -- Angela Johnson
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to