Subject Re: [firebird-support] How to call stored procedure from trigger
Author Ivan Prenosil
The syntax is
EXECUTE PROCEDURE proc_name [var [, var ...]] [RETURNING_VALUES var [, var ...]]

Ivan
http://www.volny.cz/iprenosil/interbase/

----- Original Message -----
From: "Rick DeBay" <rdebay@...>
To: <firebird-support@yahoogroups.com>
Sent: Wednesday, December 29, 2004 8:21 PM
Subject: [firebird-support] How to call stored procedure from trigger


>
> How do I correct the following trigger? It's complaining about the
> 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);
> INV_ID = EXECUTE PROCEDURE P_CREATE_INVOICE(NEW.PO, NEW.INVOICE);
>
> /* 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, 'O',
> NEW.SUBMITTED);
> end
>
> Rick DeBay
> Senior Software Developer
> RxStrategies.net