Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TRIGGER HELP

Status
Not open for further replies.

kilabru

Programmer
Oct 15, 2002
26
0
0
US
THE FOLLOWING IS THE BODY IF A TRIGGER THAT I AM USING
IT WORKS GREAT, BUT I HAVE PROBLEM.
I NEED TO PULL A COLUMN FROM ANOTHER TABLE THAT IS LINKED
TO THIS TABLE VIA RFQNUM. THE OTHER COLUMN IS CALLED "VENDOR" LOCATED IN RFQVENDOR TABLE. IS THIS POSSIBLE? THIS TRIGGER IS WITHIN A TABLE CALLED RFQLINE.

CURRENT TRIGGER:
--------------------------------------------------------
BEGIN
INSERT INTO RFQ_NEW
(RFQNUM, RFQLINENUM, ITEMNUM, DESCRIPTION, MANUFACTURER, MODELNUM, ORDERQTY, ORDERUNIT, CONVERSION, REQDELIVERYDATE, ENTERDATE, REMARK)
VALUES(
:new.RFQNUM,
:new.RFQLINENUM,
:new.ITEMNUM,
:new.DESCRIPTION,
:new.MANUFACTURER,
:new.MODELNUM,
:new.ORDERQTY,
:new.ORDERUNIT,
:new.CONVERSION,
:new.REQDELIVERYDATE,
:new.ENTERDATE,
:new.REMARK);
END;
 

Yup, you can put an sql like this before you insert.

SELECT vendor
INTO v_vendor
FROM RFQVENDOR
WHERE rfqnum = :new.rfqnum
AND ROWNUM = 1;

Don't forget to declare the variable. Robbie

"The rule is, not to besiege walled cities if it can possibly be avoided" -- Art of War
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top