Subject Re: [Firebird-Architect] IN LIST
Author Arno Brinkman
Hi,

> There are many times that the database developer can't predict (it's
> dependent on the user) an interval of records that your statement will act.
>
> Example:
> select * form t where id in (1, 5, ...)
> or
> select * from t where id between 5 and 10 or id between 20 and 30 or
> id = 50
>
> In these situations, who like to develop triggers/SPs should use EXECUTE
> STATEMENT losing the ability to handle errors early.
>
> Hence, a way to pass indeterminate number of intervals is very great:
> select * from t where id in list '5-10,20-30,50'
>
> And I see this syntax as a complement to FB2.1 LIST aggregate function,
> i.e. result of LIST can be passed to IN LIST. Example:
> select list(id) from t into :ids;
> for select * from t where id in list :ids ...
>
> Comments?

At which point (layer) do you expand the list (represented as string) into the new evaluation items
((ID BETWEEN 5 and 10) or (ID BETWEEN 20 and 30) or (ID = 50))?
If i correctly understand this wouldn't be able to use an index on ID.

Regards,
Arno Brinkman
ABVisie

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
General database development support:
http://www.databasedevelopmentforum.com

Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/

Support list for Firebird and Interbase users :
firebird-support@yahoogroups.com

Nederlandse firebird nieuwsgroep :
news://newsgroups.firebirdsql.info



--------------------------------------------------------------------------------
Mijn Postvak In wordt beschermd door SPAMfighter
1010 spam-mails zijn er tot op heden geblokkeerd.
Download de gratis SPAMfighter vandaag nog!