Home » SQL & PL/SQL » SQL & PL/SQL » Trigger error
Trigger error [message #253600] Tue, 24 July 2007 06:38 Go to next message
meeta
Messages: 28
Registered: January 2000
Junior Member
Hi everyone,
I have created a following trigger
Quote:
CREATE OR REPLACE TRIGGER INSUP_CIMCUSM1 AFTER INSERT OR UPDATE ON CIMCUSM
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
BEGIN
IF INSERTING THEN
INSERT INTO CIF_DETAILS(
BANK_CODE ,
INS_UPD
)
VALUES
(
:NEW.BANK_CODE ,
'I'
);
ELSE IF UPDATING THEN
INSERT INTO CIF_DETAILS(
BANK_CODE ,
INS_UPD
)
VALUES
(
:NEW.BANK_CODE ,
'U'
);
END IF;
EXCEPTION
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR(-200001,SQLCODE||SQLERRM);
END INSUP_CIMCUSM;


While compling ,I am getting follwoing error
PLS-00103: Encountered the symbol "EXCEPTION" when expecting one of the following:

begin case declare end exit for goto if loop mod null pragma
raise return select update while with <an identif

Can anyone please help me out

[Updated on: Tue, 24 July 2007 07:49] by Moderator

Report message to a moderator

Re: Trigger Error [message #253619 is a reply to message #253600] Tue, 24 July 2007 07:27 Go to previous messageGo to next message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Why is this in the "Networking and Gateways" forum?

Please read and follow How to format your posts and How to get a quick answer to your question: TIPS AND TRICKS
Make sure that lines of code do not exceed 80 or 100 characters when you format.
Please always post your Oracle version (4 decimals).

Non formatted code is unreadable.

Regards
Michel
Re: trigegr error [message #253630 is a reply to message #253600] Tue, 24 July 2007 07:47 Go to previous message
joy_division
Messages: 4640
Registered: February 2005
Location: East Coast USA
Senior Member
elsif not else if
And there is no purpose to say referencing old as old new as new. It's overkill (or to forward-reference the analogy later on, offer no new info). That's like using a table alias with the same name as the table.
Previous Topic: Re-write the Query
Next Topic: finding packages, Which are using particular table
Goto Forum:
  


Current Time: Mon Dec 05 12:38:21 CST 2016

Total time taken to generate the page: 0.23264 seconds