Subject Re: psql question with trigger
Author Dixon Epperson
OK, THIS WORKS,

SET TERM !!

CREATE PROCEDURE NEWSALESDATA(iFILE CHAR(1), iCOID CHAR(20), iINVOICE
CHAR(20), iINVDATE DATE,
iSTCKNO VARCHAR(20), iQTY INTEGER)
RETURNS
(oRECNO INTEGER)
AS
BEGIN
oRECNO = GEN_ID(GEN_SD_RECNO, 1);
INSERT INTO SALESDATA (SD_RECNO, SD_FILED, SD_COID, SD_INVOICE,
SD_INVDATE, SD_STCKNO, SD_QTY) VALUES(:oRECNO, :iFILE, :iCOID,
:iINVOICE, :iINVDATE, :iSTCKNO, :iQTY);
END!!


SET TERM ;

But now I have a couple of questions. If I am only going to use it
for inserting new data, why do I need to check that the SD_RECNO is null??

Also, how come it wouldn't work with
END
SUSPEND;
right preceeding the final END!!??

Thanks for the help