Subject Re: [ib-support] pb with proc
Author Arno Brinkman
Hi,

> Hi,
> I have a proc, but I can't retrieve a value with return :
>
> CREATE PROCEDURE "PROC_INS_PERI"
> (
> "SHP_NAME" CHAR(50) CHARACTER SET WIN1252,
> "PERI_TYPE" INTEGER,
> "IDENT" CHAR(40) CHARACTER SET WIN1252
> )
> RETURNS
> (
> "ID_TEMP" INTEGER
> )
> AS
> BEGIN
> ID_TEMP = GEN_ID(GEN_PERI, 1);
> INSERT into PERIMETRE
> (ID_PERI,SHP_URL,CODE_TYPE,CODE_IDENT)
> values(:ID_TEMP ,:SHP_NAME,:PERI_TYPE,:IDENT);
> END
>
>
> and I try to retrieve ID_TEMP with
> select * from PROC_PERI_INS ('aa',1,'bb');
>
>
> GEN_PERI is well upgraded,
> The insert in Perimetre is successfull,
> but I have nothing in the result of the select query ???
>
> an Idea ?

You're missing SUSPEND; before the END

CREATE PROCEDURE "PROC_INS_PERI"
<snip>
(ID_PERI,SHP_URL,CODE_TYPE,CODE_IDENT)
values(:ID_TEMP ,:SHP_NAME,:PERI_TYPE,:IDENT);
SUSPEND;
END


Regards,
Arno