passing parameters to sql script from a DOS batch file.
570330Aug 23 2011 — edited Aug 23 2011Hi,
I have an issue passing local variables to sqlplus utility from a DOS batch file,i get an error
=============================================================
SQL*Plus: Release 10.1.0.2.0 - Production on Tue Aug 23 15:05:26 2011
Copyright (c) 1982, 2004, Oracle. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
With the Partitioning option
JServer Release 9.2.0.6.0 - Production
SP2-0310: unable to open file "get_vorg_status.sql"
==============================================================
This is the snippet of the code attached.KIndly assist and advise the workaround on how to pass the variable lcl to the sqlplus utility.
Code :
@echo off
REM -----------------------------------------------------------------
setlocal
for /f %%i in ('sqlplus -s itos/naecoitos@eht @D:\Khan\Utilities\purge_quotation\quotation_counter.sql') do set lcl=%%i
echo %lcl%
set /a lcl=%lcl%+3
echo %lcl%
set DBUSER=usr
set DBPASSWD=pwd
set DBHOST=machine
set DBPORT=6516
set DBSID=test
sqlplus %DBUSER%/%DBPASSWD%@%DBSID% @get_vorg_status %lcl%
Thanks
AbdulWahab