Subject Re: [firebird-support] Parametrized View
Author Ann W. Harrison
Marcelo wrote:
>
> Is there any way to have a parametrized view?
> I used an sp but for a single record output data. Now I wanna do the
> same but the output parameter consist of a few records.
>

A selectable stored procedure may be what you want... Use a
"for select ... " to establish a cursor and a "suspend" to
return values.

The code below hasn't been run but might work...

set term ^;

create procedure table_names (low varchar (10), high varchar (10))
returning (tables varchar (32))
as begin

for select rdb$relation_name from rdb$relations
where (rdb$system_flag is null or rdb$system_flag = 0)
and rdb$relation_name >= :low
and rdb$relation_name <= :high
into :tables
do begin
suspend;
end
end^

set term ;^

select * from table_names ('a', 'g');