Subject RE: [firebird-support] How do you dynamically build a SQL Statement in a Stored Procedure?
Author Alan McDonald
> I am trying to build a resultset from a list of ID Values. I would
> like to do this in a stored procedure rather than in Delphi code
> because there are lots of queries to build the resultset, so it should
> be more efficient to do it in the database.
>
> 1) How do I pass a stored procedure a list of ID values?
> 2) How cam I dynamically build a statement like Select X from Table
> where ID value in ( Value list )?
>

if you're doing this all the time from your apps, then I would suggest you
let the db do it with a where clause. Add another field(s) to allow these
lists.
If this IN clause becomes big then you're on the wrong path anyway
Alan