Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Implied commit in dbms_sql...?
devjnr_at_gmail.com wrote:
> I'm using pl/sql developer and trying to test implied commit that
> dbms_sql should do.
>
> I copied a proc from ora docs like this:
>
> CREATE OR REPLACE PROCEDURE exec(STRING IN varchar2) AS
> cursor_name INTEGER;
> ret INTEGER;
> BEGIN
> cursor_name := DBMS_SQL.OPEN_CURSOR;
>
> DBMS_SQL.PARSE(cursor_name, string, DBMS_SQL.NATIVE);
> ret := DBMS_SQL.EXECUTE(cursor_name);
> DBMS_SQL.CLOSE_CURSOR(cursor_name);
> END;
>
>
> then I try to execute a delete statement on a test table:
>
> begin
> exec('delete from t');
> end;
>
> When I try to select data from table t from another session I still can
> see data...
>
> If I "commit;" from window where I previously executed the proc...rows
> go.
>
> Shouldn't instead be implied this commit?
>
> Is there something that escape to me...
>
> Thx to all.
>
Oracle does not assume you are committing or rolling back your transaction. That is completely up the application, as it should be. The code is a PL/SQL block that is run inside the Oracle engine. It is still up to the application to do the commit, unless you explicitly code the commit in the stored proc.
HTH,
Brian
-- =================================================================== Brian Peasland dba_at_nospam.peasland.net http://www.peasland.net Remove the "nospam." from the email address to email me. "I can give it to you cheap, quick, and good. Now pick two out of the three" - UnknownReceived on Tue Aug 29 2006 - 10:57:35 CDT