Ant SQL Task: How to Run SQL and Pl/Sql and Notice Execution Failure

Error executing SQL with Apache Ant, but not Oracle SQL Developer

With ant sql tag I couldn't run both SQL and PL/SQL in the same script even though I tried in many ways.

But using an external library I could do this.I've used this library to do that dbmaintain
Add following to your build script.

<path id="dbmaintain-lib"><fileset dir="${dbmaintain.home}/lib"><include name="*.jar"/></fileset></path>
<taskdef resource="dbmaintain-anttasks.xml" classpathref="dbmaintain.lib"/>

<target name="update-db">
<updateDatabase scriptLocations="scripts" autoCreateDbMaintainScriptsTable="true">
<database driverClassName="oracle.jdbc.driver.OracleDriver" userName="user" password="pass" url="jdbc:oracle:thin:@//localhost:1521/XE" schemaNames="SCHEMA"/>
</updateDatabase>
</target>

And everthing works perfectly now without changes to sql scripts files to replace ';'.
Hope this'll help for somebody in need.

PLS-00103: Encountered the symbol / when execute from ant build

Try to set delimitier to "/". You have than to chane your script to end all commands with "/", not only PL/SQL, but it should work.

How can I trigger an ant task only if input is newer than output?

Since I wanted to specify an arbitrary set of target files (which is cumbersome or impossible with Uptodate that only uses the Ant mapper element for multiple target files), I ended up using the ant-contrib OutOfDate task which supported what I wanted more intuitively.



Related Topics



Leave a reply



Submit