Subject | Re: Newbie Questions |
---|---|
Author | Svein Erling |
Post date | 2004-04-01T14:25:15Z |
--- In firebird-support@yahoogroups.com, "Bamsemumsy" wrote:
procedure with output parameters (o1, o2, o3, o4)
as
begin
for select ... from atable a1
into :o1
do
begin
for select ... from anothertable a2
where a2.somefield = :o1
into :o2, :o3, :o4
do suspend;
end
end
Set
> Hi,not to forget
>
> > Many thanks for your help much appreciated.
> >
> > So to do a simply select, I must return values. Then how would a
> > stored procedure with multiple recordsets work? Or is this not an
> > option?
>
> Multiple separated resultsets aren't supported. It's always a single
> resultset, with the same columns.
>
> You can, however, do stuff like this:
>
> procedure with output parameters (o1, o2, o3, o4)
>
> as
> begin
> /* return everything from a first SELECT */
> for select ... from
> into :o1, :o2, :o3, :o4
> do suspend;
>
> /* return more from a second select */
> for select ... from
> into :o1, :o2, :o3, :o4
> do suspend;
> end
>
> Or do stuff like:
>
> create procedure myproc returns (output_col varchar(20) )
> as
> begin
> output_col = 'test';
> suspend;
> output_col = '-------';
> suspend;
> output_col = 'For something';
> suspend;
> end
procedure with output parameters (o1, o2, o3, o4)
as
begin
for select ... from atable a1
into :o1
do
begin
for select ... from anothertable a2
where a2.somefield = :o1
into :o2, :o3, :o4
do suspend;
end
end
Set