|
Re: Rollback [message #157458 is a reply to message #157417] |
Thu, 02 February 2006 09:05 |
vban2000
Messages: 207 Registered: March 2005
|
Senior Member |
|
|
Hi anil
yes.. very much possible.. you can do COMMIT, ROLLBACK, SAVEPOINT in pl/sql program unit.
regards
AnDy
|
|
|
Re: Rollback [message #157511 is a reply to message #157458] |
Thu, 02 February 2006 21:37 |
anil_apps
Messages: 34 Registered: November 2005 Location: India
|
Member |
|
|
Hi AnDy,
Thanks a lot,
i have seen a pl/sql program unit in Reports contained like this
EXCEPTION WHEN OTHERS THEN
ROLLBACK;
srw.do_sql('ROLLBACK');
RETURN (FALSE);
END;
can u explain what is going on this exception. Why do we need to write srw.do_sql for commit,rollback,truncate,
Are we can directly write it...? or we have to use srw.do_sql pkg.
Regards
-anil
[Updated on: Thu, 02 February 2006 21:40] Report message to a moderator
|
|
|
Re: Rollback [message #157528 is a reply to message #157417] |
Fri, 03 February 2006 00:50 |
vban2000
Messages: 207 Registered: March 2005
|
Senior Member |
|
|
Hi anil
see the extract below, as far as I can see (and I hope is correct), there is no difference between ROLLBACK; and
srw.do_sql('ROLLBACK'); So one statement is enough. (but again test it, and let us know..)
extracted from Report Builder Help
Quote: |
SRW.DO_SQL built-in procedure
This procedure executes the specified SQL statement from within Reports Builder. The SQL statement can be DDL (statements that define data), or DML (statements that manipulate data). DML statements are usually faster when they are in PL/SQL, instead of in SRW.DO_SQL. Since you cannot perform DDL statements in PL/SQL, the SRW.DO_SQL packaged procedure is especially useful for performing them within Reports Builder, instead of via a user exit. For more information on DDL or DML statements, see the Oracle9i Server SQL Language Reference Manual
Writing DML statements in PL/SQL is faster than an SRW.DO_SQL call containing the same statement. The reason to use SRW.DO_SQL for DML statements is that it can concatenate bind parameters to construct the DML statement. For example, you can have SRW.DO_SQL create a table whose name is determined by a parameter entered on the runtime parameter form: SRW.DO_SQL ('CREATE TABLE' || :tname || '(ACOUNT NUMBERNOT NULL PRIMARY KEY, COMP NUMBER (10,2))');
|
Hope this helps..
Regards
AnDy
|
|
|