cancel
Showing results for 
Search instead for 
Did you mean: 

Database

Henry Chua
Super Advisor

Database

I tried this sql/pl script
:
CREATE OR REPLACE TRIGGER update_tab2
BEFORE INSERT ON tab1
FOR EACH ROW
begin
UPDATE tab2
SET data=1
WHERE cus_id := new.cus_id;
END;

but I got this error:

Warning: Trigger created with compilation errors.

SQL> show errors
Errors for TRIGGER QOH_INSERT:

LINE/COL ERROR
-------------------------------------------
2/4 PL/SQL: SQL Statement ignored
4/17 PL/SQL: ORA-00920: invalid relational operator

anyone know what i did wrong?
3 REPLIES

Re: Database

WHERE cus_id := new.cus_id;

That line should be an = instead of a :=
Simon Hargrave
Honored Contributor

Re: Database

I'm no SQL expert but should there really be a := instead of = in your WHERE clause?
Eric Antunes
Honored Contributor

Re: Database

See here:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=888479

:)
Each and every day is a good day to learn.