Subject Re: [Firebird-Architect] IN LIST
Author Adriano dos Santos Fernandes
Roman Rokytskyy wrote:
>> Hence, a way to pass indeterminate number of intervals is very great:
>> select * from t where id in list '5-10,20-30,50'
>>
>
> How is it supposed to work with the parameters? If it doesn't, than it
> requires constructing the statement on the fly which does not really differs
> from a combination of BETWEEN and OR predicates.
>
Like any other statement. Example:

create procedure get_items(ids varchar(200))
returns (name varchar(50)
as
begin
for select name from items where id in list :ids into :name
do
suspend;
end

select * from get_items('1-3,5')



Adriano