[yunqa.de] Re: using IN statement in a SELECT query

  • From: Delphi Inspiration <delphi@xxxxxxxx>
  • To: yunqa@xxxxxxxxxxxxx
  • Date: Tue, 09 Sep 2008 10:45:52 +0200

Hennekens, Stephan wrote:

>        When I run an sql select query like mentioned below a run error 
> occurs. Running the same query with the program SQLiteSpy then no error 
> occurs.
>        Might there be a problem with the TDISQLite3Statement object that does 
> not except the IN statement?
> 
>        Regards,
>        Stephan
>  
>        stmt: TDISQLite3Statement;      
>      
>        sql := 'SELECT * FROM customers WHERE id IN (1,2,3,4)';
>    
>        stmt := FDatabase.Prepare16(sql);
>  
>        ==> SQLIte Error 1: near "IN": syntax error 

I suppose you are running DISQLite3 Personal?

Sub-queries, sub-selects, and the IN() operator are supported by DISQLite3 
Professional only. See this feature comparison chart for details:

  http://www.yunqa.de/delphi/doku.php/products/sqlite3/feature_chart

The following change makes your SQL compatible with DISQLite3 Personal:

  SELECT * FROM customers WHERE id=1 or id=2 or id=3 or id=4;

Ralf  

_______________________________________________
Delphi Inspiration mailing list
yunqa@xxxxxxxxxxxxx
//www.freelists.org/list/yunqa



Other related posts: