|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
RAISE_APPLICATION_ERROR , does it include ROLLBACK?
Hello everybody,
Correct me if I am wrong . No code will be executed after the statement RAISE_APPLICATION_ERROR And hence rollback may be removed. moreover commit ,rollback or save point statements Should not be used in the trigger code as trigger code is executed as a part of the Triggering transaction, so the trigger code will be committed or rolled back Based on whether the triggering statement has been rolled back or committed. Example: Begin Declare X number; Begin SELECT Count(Rulesforobject.OBJECTID) into X FROM Rulesforobject WHERE cast( ld.ALERT_ID as varchar2(20) =RuleSforobject.OBJECTID; IF X > 0 Then RAISE_APPLICATION_ERROR (-20101,'This Alert cannot be deleted because its Sharing Rules "First Delete All Shared Rules"'); ROLLBACK; End If; End; End; Last edited by nelly : May 3rd, 2004 at 08:34 AM. |
|
#2
|
|||
|
|||
|
using standard dbms packages
To be brief in answering your question, yes a rollback is included when you use this standard dbms package.
In your example there was nothing to rollback, if you are trying to control code processing, you can include the exception section in your procedure or trigger to eliminate other code form executing or unpredictable results. In the example below there is nothing to rollback either, but raising the declared exception basically works like a go to, and ends the routine, thus returning to the caller. begin declare abc exception; xyz number; begin select count(*) from all_tables into xyz; If xyz <= 0 then raise abc; else null; end if; end; exception when abc then null; end; |
|
#3
|
|||
|
|||
|
Need urgent help...Does raise_application_error implicitly rollback?
Hi,
I am calling a procedure in a package from an outside script and passing 2 OUT parameters for receiving the error codes.. and messages.. In the procedure i am setting these 2 OUT parameters and then call RAISE_APPLICATION_ERROR. Now, the problem is when I try to print the OUT parameters, nothing is there. So, I have a doubt does raise_application_error will do an implicit rollback? What is the solution if I want to retain to the OUT parameters? Thanks in advance. girjia |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > RAISE_APPLICATION_ERROR , does it include ROLLBACK? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|