Re: [sqlite] Binding with Views

2009-01-22 Thread Jay A. Kreibich
On Thu, Jan 22, 2009 at 09:55:06AM +, Ed Hawke scratched on the wall:
> Hi all,
> 
> I have an SQL application that relies on using views to allow a user to 
> make an array of choices to filter down the information returned to them 
> from multiple tables, without having to code complex statements to take 
> into account the order in which they need to be applied.
> 
> To speed up this process a little I would like to use binding on select 
> statements, but I am selecting from a view and creating a new view from 
> the information returned. Without knowing what view I will be querying 
> beforehand, there is no way that I can use binding is there?

> Is there a way around this problem?

  No.  You can only bind something that can be expressed as a literal
  value.  A view name is an identifier and cannot be bound.  Your only
  choice is to manually re-build and prepare the statement each time
  the view name changes.
   
   -j

-- 
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


[sqlite] Binding with Views

2009-01-22 Thread Ed Hawke
Hi all,

I have an SQL application that relies on using views to allow a user to 
make an array of choices to filter down the information returned to them 
from multiple tables, without having to code complex statements to take 
into account the order in which they need to be applied.

To speed up this process a little I would like to use binding on select 
statements, but I am selecting from a view and creating a new view from 
the information returned. Without knowing what view I will be querying 
beforehand, there is no way that I can use binding is there?

Is there a way around this problem?

Regards,

Ed
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users