sqlplus : multiple scripts in argument (batch execution) [message #340497] |
Wed, 13 August 2008 02:13 |
123soleil
Messages: 35 Registered: July 2006
|
Member |
|
|
Hi,
I have two scripts (test1.sql and test2.sql) that need to be executed one after the other. I would like to call them both using a single command line:
sqlplus testuser/testpwd@testdb @c:\test1.sql @c:\test2.sql
This does not work
Any ideas? creating a test3.sql script that calls test1.sql and test2.sql is not an option
thanks
[Updated on: Wed, 13 August 2008 02:26] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Re: sqlplus : multiple scripts in argument (batch execution) [message #340550 is a reply to message #340543] |
Wed, 13 August 2008 04:47 |
ThomasG
Messages: 3212 Registered: April 2005 Location: Heilbronn, Germany
|
Senior Member |
|
|
That must seems to be an error inside your scripts.
Oracle Error : SP2-0024 Nothing to change
Cause : There was nothing in the SQL buffer when
using the CHANGE command.
Action : Make sure the SQL buffer is not empty before
using the CHANGE command.
Since we don't know your scripts, and you didn't even post the exact session that threw the error, you have to debug it yourself.
|
|
|
Re: sqlplus : multiple scripts in argument (batch execution) [message #340571 is a reply to message #340550] |
Wed, 13 August 2008 05:42 |
123soleil
Messages: 35 Registered: July 2006
|
Member |
|
|
my test script is as follow:
declare
test varchar(50);
begin
select 'test' into test from dual;
dbms_output.put_line(test);
end;
/
test1.sql = test2.sql
launched individually the scripts work fine... how do I find the session that throws the error? I'm in the command prompt, I execute your code, sqlplus starts, then trows the error then disconnects and i return to the command prompt.
Thanks again for your help
|
|
|
Re: sqlplus : multiple scripts in argument (batch execution) [message #340574 is a reply to message #340571] |
Wed, 13 August 2008 05:54 |
ThomasG
Messages: 3212 Registered: April 2005 Location: Heilbronn, Germany
|
Senior Member |
|
|
The session is what you do in the command prompt.
For example I have run your test.sql with my test.cmd, and it works : (with an additional "set serverout on" so that we actually SEE the dbms_output :
U:\>test.cmd
U:\>(
echo set serverout on
echo @u:\test.sql
echo @u:\test.sql
) | sqlplus user/pass@testdb
SQL*Plus: Release 9.2.0.1.0 - Production on Wed Aug 13 12:50:05 2008
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production
SQL> SQL> test
PL/SQL procedure successfully completed.
SQL> test
PL/SQL procedure successfully completed.
SQL> Disconnected from Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Pro
duction
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production
U:\>
|
|
|
|
Re: sqlplus : multiple scripts in argument (batch execution) [message #552800 is a reply to message #340586] |
Sat, 28 April 2012 13:40 |
skm_inn
Messages: 14 Registered: January 2009 Location: New Delhi
|
Junior Member |
|
|
Hi,
Please tell me in the below mentioned script provided by ThomasG
(
echo @c:\test1.sql
echo @c:\test2.sql
) | sqlplus testuser/testpwd@testdb
How do i display message before every compilation. I tried as:
(
PROMPT Compiling test1.sql
echo @c:\test1.sql
PROMPT Compiling test2.sql
echo @c:\test2.sql
) | sqlplus testuser/testpwd@testdb
But It doesn't displays PROMPT message instead just compiles and exits.
Thanks
SK
|
|
|
|
Re: sqlplus : multiple scripts in argument (batch execution) [message #552804 is a reply to message #552802] |
Sat, 28 April 2012 14:13 |
skm_inn
Messages: 14 Registered: January 2009 Location: New Delhi
|
Junior Member |
|
|
Hi,
@Littlefoot
I put PROMPT in the script as i think it will run when it connects to sqlplus.
I tried by putting
(
echo Compiling test1.sql
echo @c:\test1.sql
echo Compiling test2.sql
echo @c:\test2.sql
) | sqlplus testuser/testpwd@testdb
but i am getting the below mentioned error:
SP2-0734: unknown command beginning "Compiling ..." - rest of line ignored.
NOTE: OS : WINDOWS
|
|
|
|
|
Re: sqlplus : multiple scripts in argument (batch execution) [message #552807 is a reply to message #552804] |
Sat, 28 April 2012 14:37 |
skm_inn
Messages: 14 Registered: January 2009 Location: New Delhi
|
Junior Member |
|
|
Please find the details below:
Oracle DB: Oracle 11g 11.1.0.6.0
OS: Windows XP SP2
Hi,
@Littlefoot
I have put "PROMPT" in the script as i think it will run when it connects to sqlplus.
I tried by putting
(
echo Compiling test1.sql
echo @c:\test1.sql
echo Compiling test2.sql
echo @c:\test2.sql
) | sqlplus testuser/testpwd@testdb
but i am getting the below mentioned error:
D:\>temp
SQL*Plus: Release 11.1.0.6.0 - Production on Sun Apr 29 00:58:41 2012
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> SP2-0734: unknown command beginning "Compiling ..." - rest of line ignored.
SQL>
Procedure altered.
SQL> SP2-0734: unknown command beginning "Compiling ..." - rest of line ignored.
SQL>
Procedure altered.
SQL> Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
D:\>
|
|
|
|
|
|
|
|