Subject Re: [firebird-support] Multiple select inside procedures???
Author Martijn Tonies
> I'm trying to figure out how to get a procedure to return more than one
row. I
> know that this procedure does not work because it is supposed to return
> multiple rows and this one can't. So - how is it to be re-written som it
> works?
>
> CREATE PROCEDURE SEL_PROC_V_PRESENTASJON (
> IN_KAT VARCHAR (100))
> RETURNS (
> V_ID_KATEGORI INTEGER,
> V_KATEGORI VARCHAR (100),
> V_ID_LEVERANDOR INTEGER,
> V_LEVERANDOR VARCHAR (100),
> V_URL VARCHAR (254),
> V_KALKURL VARCHAR (254),
> KAT_CNT INTEGER)
> AS
> BEGIN

FOR SELECT ... -> will start a loop

> select ID_KATEGORI, KATEGORI, ID_LEVERANDOR,
> LEVERANDOR, URL, KALKURL
> from view_presentasjon
> where kategori like :in_kat
> order by kategori into
> :V_ID_KATEGORI, :V_KATEGORI, :V_ID_LEVERANDOR,
> :V_LEVERANDOR, :V_URL,:V_KALKURL;
> suspend;

DO SUSPEND;

-> DO <something in the loop>

> END
>

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server
Upscene Productions
http://www.upscene.com