Subject | RE: [firebird-support] How to call stored procedure from trigger |
---|---|
Author | Leyne, Sean |
Post date | 2004-12-29T20:27:32Z |
> How do I correct the following trigger? It's complaining about theEXECUTE PROCEDURE P_CREATE_PO(NEW.PO, NEW.DIST_CTR, NEW.NABPNUM,
> EXECUTE PROCEDURE part.
>
> DECLARE VARIABLE PO_ID BIGINT;
> DECLARE VARIABLE INV_ID BIGINT;
> begin
> /* create new/find existing PO and invoice */
> PO_ID = EXECUTE PROCEDURE P_CREATE_PO(NEW.PO, NEW.DIST_CTR,
> NEW.NABPNUM, NEW.GRANTEE, NEW.SUBMITTED);
NEW.GRANTEE, NEW.SUBMITTED) RETURNING_VALUES PO_ID;
> INV_ID = EXECUTE PROCEDURE P_CREATE_INVOICE(NEW.PO, NEW.INVOICE);EXECUTE PROCEDURE P_CREATE_INVOICE(NEW.PO, NEW.INVOICE) RETURNING_VALUES
INV_ID;
>'O',
> /* create order-item record */
> INSERT INTO ORDER_ITEM(PURCH_ORDER, NDC, QTY, INVOICE, DIST_CTR,
> STATUS, STATUS_CHNG)
> VALUES (:PO_ID, COALESCE(NEW.NDC_SUB, NEW.NDC),
> COALESCE(NEW.QTY_SHIP_SUB, NEW.QTY_SHIPPED), :PO_ID, NEW.DIST_CTR,
> NEW.SUBMITTED);
> end