Subject Stored Procedure - Using variables
Author Marcello Fontolan
Hello,

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?


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

--

..::
Marcello Fontolan
marcello@...
::..