I would like to write a bat or a shell that run stand-alone sql scripts and stop if a query don't succeed.
I wrote yet a bat (to run sql via dbaccess) and a shell sh (to run sql via sqlplus) there concatene all sql scripts and run the obtained script, but in this case, I can't correct a bad sql script before run the next script.
This is my problem. If I run the next scrit while the previous return an error, I take the risk that the databasa update to be corrupted.
So, I want to list the scripts in the directory
Run the first script
Retrieve the result (succeed or error)
Run the next script if the previous succeed
Or stop if the script return an error
And print all queries and result in a file.log
You can read the bat and the shell in this post :