ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anderson, Rob H - VSCM" <>
Subject RE: creating pl/sql package in sql task, only part of package lo aded
Date Fri, 28 Feb 2003 00:12:37 GMT
OK. That makes sense now (mostly). I am looking at the source for the sql
task and it looks like you can set the attribute delimitertype="row" to
achieve the functionality you describe below. Here is a quote from the
source code comments...

     * Set the delimiter type: "normal" or "row" (default "normal").
     * <p>The delimiter type takes two values - normal and row. Normal
     * means that any occurence of the delimiter terminate the SQL
     * command whereas with row, only a line containing just the
     * delimiter is recognized as the end of the command.</p>

This is not in the documentation for the task, and I have never tested it,
but it looks like the functionality exists.

I just got done adding the keepformat attribute to the sql task. It seems to
be working for me with the following usage.

        <target name="lib:sql">
                <sql driver="${db.driver}"

I am using a line with a singe "/" as a delimiter. I will send the code
attached to an email from my hotmail account because the attachments from
this account don't seem to make it to the list.

-Rob Anderson  

-----Original Message-----
From: Jose Alberto Fernandez []
Sent: Thursday, February 27, 2003 4:07 AM
To: Ant Developers List
Subject: RE: creating pl/sql package in sql task, only part of package
lo aded


I am saying two things:

1) SQL Blocks (as you call them) are already supported by defining a
delimiter other 
than ";" (i.e., delimiter=";;" is what I use)*

2) When you are loading big things like blocks into the RDBMS it seems
to keep the formatting as is. Hence, we should add the new "keepFormating"

The second can be achieved quite simply in the current <sql> code. The first
is already there.

*There is an additional thing that eventhough not necessary could be nice
for Oracle PLSQL
users, that is to support the idea of a line containing just the delimiter
as the valid delimiter.
To be able to specify that the delimiter in the middle of a line should not
count as such. [confused already :-)]

We could add another attribute "lineDelimiter=true" to achieve that. So to
process PLSQL files valid in sqlplus
You would say:

 <sql driver="${db.driver}"
         <fileset dir="${db.sql.dir}" casesensitive="no">
                 <include name="**/*.sql"/>
the defaults would be lineDelimiter=false, keepFormating=false,
delimiter=";" (for backward compatibility).

Suggestions from others on attribute names are appreciated.

Jose Alberto
> From: Anderson, Rob H - VSCM []
> Jose, I think it is a good idea to include this functionality 
> in the sql
> task. I am not sure how we would alter the usage of the sql 
> task. You are
> suggesting we have a keepFormat attribute, correct? However, 
> my task is
> bassically meant to deal with a sql block, and does not care about
> formatting. In other words, formatting is always kept, 
> comments and all.
> That being said, I would suggest that we simply have a boolean flag to
> indicate whether or not to process the sql, or file(s) 
> containing sql, as a
> block. For example:
> <sql driver="${db.driver}"
> 	print="true"
> 	sqlblock="true"
> 	url="${db.url}"
> 	userid="${db.userid}"
> 	password="${db.password}">
>         <fileset dir="${db.sql.dir}" casesensitive="no">
>                 <include name="**/*.sql"/>
>         </fileset>
> </sql>
> Then, to integrate this into the existing sql task I will 
> move the statement
> processing part of the two tasks into two new methods, one of which is
> executed based on the sqlblock flag, which defaults to false. 
> Thoughts?
> Suggestions?
> -Rob Anderson

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message