Sqlplus in Batch script

HI
I am using batch script to invoke sqlplus  to execute   sqlfiles in various directories.  
for example  
--Release_1,25 ---------------------------------<directory>
     --Release_1.25.sql --------------------------<file>
      --4401 --------------------------------------------<directory>
           ----4401.sql ------------------------------------<File>
      --4402-----------------------------------------------<directory>
             ---4402.sql -------------------------------------<file>



Release_1.25.sql  follwoign things

<create>
<Update>
<etc etc>
@@4401/4401.sql
@@4402/4402.sql



my batch script calls

sqlplus -S User/PWD@db  @<path/to/>Release_1.25.sql



I get  the error
SP2-0310: unable to open file "4401/4401.sql"
SP2-0310: unable to open file "4402/4402.sql"



It looks like Sql plus find the calling script Release_1.25.sql but is unable to find path s is not able to find the path








     
  -
maverickxxAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill PrewCommented:
I did a very simple test of this in a folder here, seemed to work fine, but ONLY if my default directory was set to the folder where the first script is located, in your case the "Release_1,25" folder.  I tried it from outside that folder and the first script ran but the other two failed.

I agree the documentation for @@ makes it sound like it should work either way, but it doesn't seem to on Windows.

So add a CD (or PUSHD / POPD) to your "Release_1,25" folder before running the first main SQL, should work.

~bp
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
maverickxxAuthor Commented:
Pushd/popd worked thank you!
0
Bill PrewCommented:
Welcome, glad that helped.

~bp
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.