Executing PL/SQL from ANT - how to keep the format straight tools 15649 6401

Executing PL/SQL from ANT – how to keep the format straight

Just read the post Executing Oracle PL/SQL from Ant on how to use Ant for executing PL/SQL tasks, such as creating Packages and Stored Procedures. I have used Ant for that in the past. However, one of the problems I ran into was the fact that PL/SQL objects created by Ant had all their PL/SQL Code on a single line; impossible to work with from tools such as TOAD and PL/SQL Developer.

In this post, I read for the first time about the keepformat attribute in the Ant SQL task. This property supposedly ensures that the code will be created as it is defined in the Ant task or the imported external file.

<sql rdbms="oracle"
     userid="scott"
     password="tiger"
     driver="oracle.jdbc.OracleDriver"
     url="jdbc:oracle:thin:@myhost:1521:orcl"
     classpathref="classpath"
     delimiter="/"
     delimitertype="row"
     keepformat="yes"
   <transaction src="create_package.sql"/>
</sql> 

It is in the Ant Documentation (see: SQL Task) so I must have searched lousily last time. Any way, good to know it can be so simple.

3 Comments

  1. Kennedy September 2, 2008
  2. zdenek Vrablik August 17, 2006
  3. Aino June 15, 2005