How do I send two session-setting calls in one SQL string?

From: Joe Weinstein <joeNOSPAM_at_bea.com>
Date: Fri, 20 Feb 2004 09:07:48 -0800
Message-ID: <40363ec9$1_at_news.beasys.com>



[Quoted] [Quoted] Hi. I have a JDBC client to Oracle, and I want to initialize two session settings in one SQL string sent to the DBMS. I can do things like sending two normal updates in one string like:

"BEGIN insert into mytable values(...); insert into myOthertable values(...); END;"

[Quoted] I am naively trying:

"BEGIN alter session set nls_date_format = 'MM/DD/YYYY'; set role xxxx_role identified by xxxx; END;".

[Quoted] This fails*. Is there working syntax for what I want to do? Thanks in advance,

Joe Weinstein at BEA

  • ORA-06550: line 1,column 7: PLS-00103: Encountered the symbol "ALTER" when expecting one of the following: [Quoted] begin declare exit for goto if loop mod null pragma raise return select update [Quoted] while <an identifier> <a double-quoted delimited-identifier> <a bind variable> [Quoted] close current delete fetch lock insert open rollback savepoint set sql commit <a single-quoted SQL string> The symbol "update was inserted before "ALTER" to continue. ORA-06550: line 1, column 61: PLS-00103: Encountered the symbol "ROLE" when expecting one of the following: transaction
Received on Fri Feb 20 2004 - 18:07:48 CET

Original text of this message