Home » SQL & PL/SQL » SQL & PL/SQL » Regarding Error with Trigger
Regarding Error with Trigger [message #231727] Wed, 18 April 2007 04:53 Go to next message
chandrasekharbomminisidda
Messages: 21
Registered: March 2007
Location: Chennai
Junior Member
Respected Sir,
I am having trigger

1 create or replace trigger ALL_REPORT_USER_tm_tr
2 before insert on ALL_REPORT_USER_tm
3 for each row
4 begin
5 if (:new.user_id is null) then

6 raise_application_error(-20001, 'Invalid u have to pass the user_id');
7 end if;
8 end;

Trigger created and when i tried to insert a null value in user_id i am getting the message which i raised through raise application error . In addition to that i am getting error also

The error i am getting is

ORA-06512: at "OTSLGWEB.ALL_REPORT_USER_TM_TR", line 3
ORA-04088: error during execution of trigger 'OTSLGWEB.ALL_REPORT_USER_TM_TR'

Even when i execute the command
show errors trigger all_report_user_tm_tr;
No errors for TRIGGER OTSLGWEB.ALL_REPORT_USER_TM_TR

It's giving the above message when i use the command show errors trigger trigger name.

Why it is giving me the error at for each row part.

Please give the solution for above said problem.
which will help me Sir.

Sincerely,
Chandrasekhar B.S
Re: Regarding Error with Trigger [message #231731 is a reply to message #231727] Wed, 18 April 2007 04:57 Go to previous messageGo to next message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This is how it works.
There is nothing to workaround this.
You can "substr" the error message in your application.

Regards
Michel
Re: Regarding Error with Trigger [message #231748 is a reply to message #231731] Wed, 18 April 2007 05:36 Go to previous messageGo to next message
chandrasekharbomminisidda
Messages: 21
Registered: March 2007
Location: Chennai
Junior Member
The Error message i gave is coming completely, But inaddition to that ora-06512 and ora-04088 errors also coming I don't know why it is throwing that error messages. Even i was tried to use substr function in raise_application_error function also . I am getting the same. Please tell me regarding this

ORA-20001: Invalid u have to pass the user_id
ORA-06512: at "OTSLGWEB.ALL_REPORT_USER_TM_TR", line 3
ORA-04088: error during execution of trigger 'OTSLGWEB.ALL_REPORT_USER_TM_TR'


Regards,
Chandrasekhar B.S.
Re: Regarding Error with Trigger [message #231772 is a reply to message #231748] Wed, 18 April 2007 06:44 Go to previous messageGo to next message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Same answer.
The message returns and will return completly to your application that is your message in raise_application_error plus what Oracle adds around. Nothing to do with that.
When you receive the message in your application and move it to a variable you can remove the unwanted part in your variable.

Regards
Michel
Re: Regarding Error with Trigger [message #231790 is a reply to message #231727] Wed, 18 April 2007 07:35 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Quote:
6 raise_application_error(-20001, 'Invalid u have to pass the user_id');

IM-speak in error messages.. How lazy can you get.
Previous Topic: Quer to select value of a column as comma seperated string
Next Topic: peak Off Peak
Goto Forum:
  


Current Time: Mon Dec 05 19:13:37 CST 2016

Total time taken to generate the page: 0.08059 seconds