Subject | Re: [firebird-support] Parametrized View |
---|---|
Author | Ann W. Harrison |
Post date | 2005-12-26T21:36:26Z |
Marcelo wrote:
"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');
>A selectable stored procedure may be what you want... Use a
> 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.
>
"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');