Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> help with commits and rollbacks in PL/SQL

help with commits and rollbacks in PL/SQL

From: Haresh Assumal <assumal_at_sprynet.com>
Date: 1997/11/14
Message-ID: <01bcf13c$75727b60$fab1aacc@mycomp.intermediainc.com>#1/1

Hello,
I have a question about exceptions in PL/SQL. I was under the impression that if an exception is raised a rollback is perfromed. However this is not the case. If I have a function a table called foo and a function called update foo as follows:

create table foo(id number);

create or replace function insert_foo
return number

is

        my_exception EXCEPTION;
begin

	insert into foo values(1);
	raise my_exception;
	insert into foo values(2);
	return 0;
exception
	when my_exception then
		return -1;
	when others then
		return -3;

end;

When this function is called the data value 1 is inserted into foo, why doesn't is get rolled back ?
Thanks,
Haresh
e-mail: assumal_at_sprynet.com Received on Fri Nov 14 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US