[sqlite] reuse of named parameters within a single statement

2010-05-04 Thread Aron Rubin
Sorry if this is a repeat but I am having a heck of a time figuring
out a definitive answer to a this question on the list. Certainly it
is not addressed in the documentation.

Is the following valid string to prepare:
SELECT @myparam, @myparam, @myparam, @myotherparam

If so, which is it equivalent to:
A - SELECT ?1, ?1, ?1, ?2
or
B - SELECT ?1, ?2, ?3, ?4

Aron
-- 
Aron Rubin
Handy Husband  Daddy Jungle Gym  Senior Engineer
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] reuse of named parameters within a single statement

2010-05-04 Thread Aron Rubin
It would be great to include  SELECT @myparam, @myparam,
@myotherparam, @myparam is it equivalent to SELECT ?1, ?1, ?2, ?1
in the documentation on parameters (in expressions).

Thank you,
Aron

On 5/4/10, Jay A. Kreibich j...@kreibi.ch wrote:
 On Tue, May 04, 2010 at 01:48:52PM -0400, Aron Rubin scratched on the wall:
 Sorry if this is a repeat but I am having a heck of a time figuring
 out a definitive answer to a this question on the list. Certainly it
 is not addressed in the documentation.

 Is the following valid string to prepare:
 SELECT @myparam, @myparam, @myparam, @myotherparam

 If so, which is it equivalent to:
 A - SELECT ?1, ?1, ?1, ?2
 or
 B - SELECT ?1, ?2, ?3, ?4

   A.

 --
 Jay A. Kreibich  J A Y  @  K R E I B I.C H 

 Our opponent is an alien starship packed with atomic bombs.  We have
  a protractor.   I'll go home and see if I can scrounge up a ruler
  and a piece of string.  --from Anathem by Neal Stephenson
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



-- 
Aron Rubin
Handy Husband  Daddy Jungle Gym  Senior Engineer
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Small change to support poor man's extended features

2010-05-04 Thread Aron Rubin
If I could have a SQL function that returned an id of the current
frame I could create poor man's variables. In turn that would allow me
to create return locations for stored procedure triggers and
branching. The id would need to be unique against any parallel
executions.

-- 
Aron Rubin
Handy Husband  Daddy Jungle Gym  Senior Engineer
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Small change to support poor man's extended features

2010-05-04 Thread Aron Rubin
On Tue, May 4, 2010 at 9:00 PM, Roger Binns rog...@rogerbinns.com wrote:
 On 05/04/2010 03:50 PM, Aron Rubin wrote:
 If I could have a SQL function that returned an id of the current
 frame I could create poor man's variables.

 You'll need to be more specific about what you mean here.  Give an example
 of the code you would like to write.  The only use of the word frame I
 know of in this context is stack frame.  It is certainly possible to do what
 you ask in Python (sys.getframe) but SQLite is in C and that doesn't require
 physical frames or return locations.

Most execution environments that support calling including C and
Sqlite use a stack of frames. Looking at the Sqlite code, VDBE
maintains a stack of frames. I am suggesting that these frames are
assigned an id that is unique for that parallel execution. Since I do
not know the rules, present or planned, for parallelism in Sqlite I
cannot clearly define what those ids are. If each parallel path, i.e.
database open from programs, is assigned a unique id then the
combination of that id and the call depth would be sufficient for my
purposes.

Aron

-- 
Aron Rubin
Handy Husband  Daddy Jungle Gym  Senior Engineer
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users