Subject | Re: [firebird-support] Stored Procedure - Using variables |
---|---|
Author | Helen Borrie |
Post date | 2004-03-20T23:33:48Z |
At 08:24 PM 20/03/2004 -0300, you wrote:
prefix its name with a colon (:)
> Hello,When you refer to a variable (local, input or output) in an SQL statement,
>
> I'm trying use the stored procedure above but it is not accepting
>GEN_PEDI as a column.
> There is any reserved word that I can use for this, like var.GEN_PEDI?
> How can I contorn this issue?
prefix its name with a colon (:)
>/hb
>
>ALTER PROCEDURE TMPEDI_TO_PEDI (PEDI INTEGER)
>RETURNS (GEN_PEDI INTEGER)
>AS
>BEGIN
> GEN_PEDI = GEN_ID(GEN_PEDI_ID, 1);
>
> INSERT INTO PEDI
> SELECT :GEN_PEDI, CLIE, DEMI, VPRO, VSER, 0, 0, 0, 0, LOGG
> FROM TMPEDI WHERE PEDI = :PEDI;
>
> INSERT INTO PEDIITEM
> SELECT :GEN_PEDI, PROD, BSER, QSAI, VUNI
> FROM TMPEDIITEM WHERE PEDI = :PEDI;
>
> DELETE FROM TMPEDI WHERE PEDI = :PEDI;
> DELETE FROM TMPEDIITEM WHERE PEDI = :PEDI;
>
> SUSPEND;
>END