Why do you think SQLPlus is not suitable for use in packages? It is quite common to use it to run these types of scripts - you can pass the script to SQLPlus when you call it if you want, i.e.
sqlplus scott/ tiger@someDatabase @someScript.sql
This is a fairly common way to deploy assemblies.
If the problem is with the way SQL * Plus handles errors, you can simply add a line
WHENEVER SQLERROR EXIT SQL.SQLCODE
to abort and throw the Oracle error number that was detected. The documentation for the WHENEVER SQLERROR command also provides a number of other parameters.
Justin cave
source share