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

Lucas Jellema 3
0 0
Read Time:54 Second

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.

About Post Author

Lucas Jellema

Lucas Jellema, active in IT (and with Oracle) since 1994. Oracle ACE Director and Oracle Developer Champion. Solution architect and developer on diverse areas including SQL, JavaScript, Kubernetes & Docker, Machine Learning, Java, SOA and microservices, events in various shapes and forms and many other things. Author of the Oracle Press book Oracle SOA Suite 12c Handbook. Frequent presenter on user groups and community events and conferences such as JavaOne, Oracle Code, CodeOne, NLJUG JFall and Oracle OpenWorld.
Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

3 thoughts on “Executing PL/SQL from ANT – how to keep the format straight

  1. Hi,

    There is a much better way of executing plsql scripts using ant. I tried the sql task but failed when creating user defined functions.

    visit this site to get more information about sqlplus task created for oracle. http://incanto.sourceforge.net/usage.html

    if you use this task you also get feedback in terms of error sucess.

    Thanks,
    Ken. 😉

  2. HI, it works, but i am not able to get possible compilation errors back to ANT.
    Is there any possibility to see compilation errors in ant script?

    Thanks Zdenek

  3. Nice way to integrate the built process with PL/SQL unittesting (utPL/SQL) and documentation generation (PLDoc).

Comments are closed.

Next Post

How to call methods from EL expressions- pre JSP 2.0 trick for JSPs with JSTL

I finally got round to describing a trick that I have implemented more than one year ago. It happened to come up during last week’s Spring workshop, so I decided decided to write it down after all. You probably know that EL Expressions in JSTL tags can refer to Objects […]
%d bloggers like this: