Subject | Re: [Firebird-Architect] transient data sets and procedures |
---|---|
Author | Ann W. Harrison |
Post date | 2005-02-17T17:35:34Z |
Whoops! There's a typo in the procedure definition in the example...
declare fat_cats transient data set
> create procedure fattest_cats (counter integer)should be
> returns (name varchar (30), age integer, salary integer)
> as
> declare fatter_cats transient data set
declare fat_cats transient data set
> (name varchar (30), age integer, salary integer);
> begin
> for select first :counter f.name, f.age, f.salary
> from fat_cats f
> join health_records hr
> on (f.name = hr.name and f.age = hr.age)
> order by hr.weight descending
> into :name, :age, :salary
> do begin
> suspend;
> end
> end
>
>
> Here's a segment of application pseudo code..
>
>
> ...
> select p.name, p.age, p.salary
> from people p
> where p.salary > 100000
> yielding fat_cats;
>
> select fc.name, fc.age, fc.salary
> from fat_cats (5) yielding fat_cats;
>