Dave Dyer wrote:
I can't find an example, but it seems like there ought to be syntax to use bind to inline selection variables, instead of
having to have a callback function.

Something like:

 char *forval,*barval;
 sqlite_prepare(db,"select ?foo,?bar from table");
 sqlite_bind("?foo",&fooval);
 sqlite_bind("?bar",&balval);

while () { sqlite_step() // foo and var bound to current values
        }

can someone point me to an example, or good documentation?



Dave,

That can be done, but it will probably not do what you want.

A parameter can be placed in your SQL anywhere the syntax allows an expression. Since SQL allows an expression as a result column you can use a parameter there. The net effect will be to return the value you bind to the parameter as the value of that column for every row. It does not give you a mechanism to select different columns by changing the bound value at runtime.

HTH
Dennis Cote

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to