Subject Re: Newbie Questions
Author donjules2k
Great! thanks for all your help, this should really get me going now.
Shame I can't do multiple recordsets :o(

Thanks again.

Giulio

--- In firebird-support@yahoogroups.com, "Svein Erling"
<svein.erling.tysvaer@k...> wrote:
> --- In firebird-support@yahoogroups.com, "Bamsemumsy" wrote:
> > Hi,
> >
> > > 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
>
> not to forget
>
> 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