Hi Team,
I have updated my Toad for Oracle from Version 9.7.1 to 13.1.0.78 and now the batch file is not working.
I created a batch file to run a .sql file using older version of Toad(Version 9.7.1). We updated the toad to latest version (Version 13.1.0.78) but now the batch file is not able to execute the .sql file. I changed the URL so that it refer to new toad.exe file, batch file is able to open the sql file but unable to run it.
Below is the code
echo start cls
C:
cd C:\Program Files (x86)\Quest Software\Toad for Oracle 13.1\ %systemroot%\Syswow64\cmd.exe /K Toad.exe -c USER_ID/Password@Database -f "C:\working\Automation\Batch_Files\TPR_Code_SCDM_Auto.sql" /exec
-f just loads a file into the editor. Add /EXEC if you want it to execute automatically.
Edit:
Oops! I see you have /exec in there already. Change it to uppercase and it should work.
Also, have a look at Toad's Automation Designer to learn about how to do more things from command line with Toad. It's in the help file, but you can also find out a lot about it by searching this forum.
Oops, sorry, I must have tested with 13.2 before and not 13.1
I can reproduce the problem even with uppercase in 13.1.
In the meantime, if you don't mind running your command as script, then this works:
If it needs to happen in the same session as main Toad connection, go to Options -> Oracle -> Transactions, then make sure "Execute scripts in Toad Session" is checked.
I'll look into 13.1 EXEC and see if I can find the problem there. WIll get back to you on that.
Well, it is definitely broken in 13.1, and I don't think there is anything you can do to make it work.
So your workarounds are:
Use /SCRIPT instead of /EXEC
Download the 13.2 beta and use that instead.
If you can use the beta, please do. The nice thing about that is if you find a problem, we can usually have a fix for you in a day or two. I'd really like to see a lot more beta users. It's good for you, and good for Toad.
it again give prompts that ask Commit or Rollback.
Add a commit at the end of your script and I think the prompt will go away.
If your goal is to just run some SQL and then exit Toad, you really should use the automation designer. It will really simplify your batch file, and you won't need EXIT or EXIT /B anymore.
I made a video of how to set it up and how to run it. I forgot to show in the video that you need to have the "save passwords" option in the login screen turned on.