I made a batch script that iterates recursively through all the .sql files under a directory. My problem is that i can echo all the files treated correctly with this version :
@for /r "%PWD%\06-Instalaciones" %%a in (*.sql) do (IF "C:%%~pa" NEQ "%PWD%06-Instalaciones\ProximaInstalacion\" echo %%~fa )
But i cant seem to sucessfully call SqlPlus instead of the echo, for every sql file treated :
@for /r "%PWD%\06-Instalaciones" %%a in (*.sql) do (IF "C:%%~pa" NEQ "%PWD%06-Instalaciones\ProximaInstalacion\" %ORACLE_HOME%/bin/sqlplus -L -S FOO/BAR@%sid% @%%~fa)
I get the following error : "(HOST was unexpected at this time.".
Thank you.
echobefore%ORACLE_HOME%/bin/..., to see what the command expands to, and if there is a parameter with spaces that needs quoting.%%G, since%~faalready has the meaning filename + attributes.