SQL script - Batch File [message #368184] |
Tue, 26 September 2000 08:59 |
Chella
Messages: 25 Registered: September 2000
|
Junior Member |
|
|
I have a sql script (..\Bin\temp\test.sql) to load the data to Excel as follows;
---------------------------------------
declare
output utl_file.file_type;
begin
output := utl_file.fopen( 'c:\temp\', 'epoctrans.slk', 'w');
utl_file.fclose( output );
output := utl_file.fopen( 'c:\temp\', 'epoctrans.slk', 'w',32000);
owa_sylk.show(
p_file => output,
p_query => 'select * from scott.tblMailBoxData where CustAcNumber = :CustAcNumber',
p_parm_names =>
owa_sylk.owaSylkArray( 'CustAcNumber'),
p_parm_values =>
owa_sylk.owaSylkArray( '11318624' ),
p_show_grid => 'YES' );
utl_file.fclose( output );
end;
----------------------------------------
At the SQL prompt, I type @..\Bin\test.sql and then on the next line I have to type '/' for the script to get executed. The script works fine and produces the SLK file. Then I created a batch file (.BAT) and it contains the following code;
---------------------------------------------
D:\Orant\Bin\Plus80.exe scott/tiger@chelladb @D:\Orant\Bin\test.sql
---------------------------------------------
When I run the batch file at the Windows command prompt, it waits for the '/' to be entered, same situation as SQL prompt. Can anyone tell me how can I just let the batch file to do the execution without any user interuption and at the end, the SQL session should be closed as well. Help is really appreciated.
|
|
|
|
|
Re: SQL script - Batch File [message #368203 is a reply to message #368184] |
Fri, 29 September 2000 00:20 |
Suneet
Messages: 3 Registered: September 2000
|
Junior Member |
|
|
Hi,
If u want to end SQL session at the end of the batch file, create an sql file, say test1.sql with contents -
@test.sql
exit
Place this in the same directory as test.sql. and then execute this file instead of test.sql from command prompt.
Hope this helps.
|
|
|