1748169 Members
3743 Online
108758 Solutions
New Discussion юеВ

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 3
John Wimmer_1
Advisor

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.