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
Show Datediff as Seconds, Milliseconds
SQL - Subquery in Aggregate Function
Arel Causing Infinite Loop on Aggregation
Sql: Count() Based on Column Value
Sql Server 2012 Sp_Helptext Extra Lines Issue
Sql Efficiency - [=] Vs [In] Vs [Like] Vs [Matches]
What Does "Where 1" Mean in Sql
Optimising a Select Query That Runs Slow on Oracle Which Runs Quickly on SQL Server
Check If a Variable Is Null in Plsql
How to Remove SQL Azure Data Sync Objects Manually
Sqlplus Spooling: How to Get Rid of First, Empty Line
Why Are SQL Server Inserts So Slow
Selecting The Most Common Value from Relation - SQL Statement