Subject | Re: [Firebird-Architect] IN LIST |
---|---|
Author | Adriano dos Santos Fernandes |
Post date | 2006-12-03T14:26:05Z |
Roman Rokytskyy wrote:
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
>> Hence, a way to pass indeterminate number of intervals is very great:Like any other statement. Example:
>> 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.
>
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