I am trying to develop an ANT script that calls SQL*Plus and executes a SQL file. Using the following:
<exec executable="sqlplus" failonerror="true">
<arg value="-LOGON"/>
<arg value="scott/${db.pwdapps}"/>
<arg value="@${scm.target}/install/sql/XXCUST_COMMON_PKG.pks"/>
</exec>
This works but when the username or password is incorrectly supplied, SQL*Plus returns with status of success and hence ANT returns the same.
Anyone know how to make SQLPlus return an error status when the username or password is incorrect?
Convert the script to use a here document, or have the script to do the connect after setting the sqlerror and pass the connect info as arguments for the script.