As a part of our build process we want to execute SQL Scripts consisting of DDL and DML statements against a fresh database instance.
ADO.NET Connection/Command can’t handle this without parsing and splitting the scripts.
The sqlplus command line utility can execute scripts only interactively, and isn’t suited for batch usage.
What am I missing? How can one execute sql scripts when using oracle?
Why do you believe that the SQLPlus utility isn’t suited for batch usage? It’s pretty common to use it for running these sorts of scripts– you can pass the script to SQLPlus when you invoke it if you’d like, i.e.
That is a pretty common way of deploying builds.
If the problem is with the way SQL*Plus is handling errors, you can simply add the line
to abort and throw the Oracle error number that was encountered. The documentation for the WHENEVER SQLERROR command provides a number of other options as well.