[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

11/04/2009 at 07:13PM PST, ID: 24873375 | Points: 500
[x]
Attachment Details

How to Rollback a function in Oracle

Asked by ncsvietnam in Databases Miscellaneous, Oracle CRM, PL / SQL

Tags: Oracle, PL/SQL

Hi experts,

Please help me out this problem!?
I have a function calls other functions inside it's body, pls see it in the attached code.

My question is how to rollback fcn_B and func_C if fcn_D raise an exception?

Thanks!
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
function A return varchar2 is
v_RET varchar2(100)
begin
    v_RET := fcn_B('test'); -- insert a record to B table
    v_RET := fcn_C('test'); -- insert a record to C
    v_RET := fcn_D('all'); -- insert a record to D 
    return v_RET;
    exception when others then rollback;
end;
[+][-]11/04/09 10:15 PM, ID: 25747113

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/04/09 11:22 PM, ID: 25747356

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-91 - Hierarchy / EE_QW_3_20080625