Home » SQL & PL/SQL » SQL & PL/SQL » COMMIT inside a PL/SQL script
COMMIT inside a PL/SQL script [message #37644] Mon, 18 February 2002 19:59 Go to next message
meann
Messages: 3
Registered: February 2002
Junior Member
gud day!! how can I issue a COMMIT to save changes only within the currently running PL/SQL script? If for example I have PL1 calling PL2. I want to COMMIT changes within PL2 but not save transactions in PL1. Is is possible?
Re: COMMIT inside a PL/SQL script [message #37649 is a reply to message #37644] Tue, 19 February 2002 00:59 Go to previous messageGo to next message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
i do not think so.you can rollback to savepoint, but can not do the same in commit. if u coomit in PL2 then it will commit the whole. transaction including PL1
Re: COMMIT inside a PL/SQL script [message #37662 is a reply to message #37649] Tue, 19 February 2002 10:13 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
in 8i you can use PRAGMA AUTONOMOUS TRANSACTION in pl/sql.

SQL>declare
  2     PRAGMA AUTONOMOUS_TRANSACTION;
  3  BEGIN
  4     INSERT INTO MY_TAB
  5          VALUES (1, SYSDATE, 'hello');
  6
  7     COMMIT;
  8* END;
SQL> /

PL/SQL procedure successfully completed.

Previous Topic: tkprof
Next Topic: How to generate sequence number in a column.....
Goto Forum:
  


Current Time: Thu Apr 18 15:25:52 CDT 2024