SQLPLUS récupérer la variable
Bonjour,
J'ai SQLPLUS qui me renvoie ceci :
-------------------------------------------
Citation:
SQL*Plus: Release 9.2.0.1.0 - Production on Tue Jul 28 16:26:38 2009
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
Enter value for 1:
-------------------------------------------
Avec un .bat contenant le code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| @echo off
set INSTANCE=itracker
set USER=adexpl
set PASSWORD=SGBD00exploit
set SPACEHOME=F:\surveillance_applicative\sentinel
set SQLPL=sqlplus.exe
set ORACLE_SID=%INSTANCE%
d:
cd %SPACEHOME%
set table=PANELLIST
FOR /F "delims=; tokens=1,2*" %%i IN (%SPACEHOME%\exe\liste-windows.txt) DO (
Set table2=%%i
%SQLPL% %USER%/%PASSWORD% @%SPACEHOME%\exe\fg.sql %table2% >> %SPACEHOME%\log\Nbre_Xfers_Erreur_du_jour_%dt%_%%i.log
echo "%SQLPL% %USER%/%PASSWORD% @%SPACEHOME%\exe\fg.sql %%i" >> %SPACEHOME%\log\toto.txt
) |
-------------------------------------------
Dans liste-windows.txt, il y a :
Citation:
NOMSERVEUR1;PARAMServer1
NOMSERVEUR2;PARAMServer2
-------------------------------------------
et le fichier fg.sql contient :
Code:
1 2 3
|
select count(*) from itracker.historic_5 where LOCATION=&1;
exit |
-------------------------------------------
Ma question est : comment je peux passer en paramètre la valeur %%i ?
Merci d'avance pour votre aide.