Subject Re: Parametrized View
Author Adam
--- In firebird-support@yahoogroups.com, "Marcelo" <pcpower099@y...>
wrote:
>
> Hi all!
>
> 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.

Stored Procedures are able to return multiple records. They return a
record every time suspend is called.

Here is an example

create procedure sp_getallemployees
(
name varchar(50)
)
returning
(
id integer,
dob timestamp
)
as
begin
for
select id, dob
from employee
where upper(name) = upper(:name)
into :id, :dob
do
begin
suspend;
end
end
^

This is called by

select *
from sp_getallemployees('Adam');

This is more powerful then a "paramatised view", as you can perform
operations, raise exceptions etc

> PD: thanks Adam for your answer to the code protection methods !!!
>

No problems.

Adam