Rob,

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 useful
to keep the formatting as is. Hence, we should add the new "keepFormating" 
attribute.

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}"
        print="true"
        lineDelimiter="true"
        delimiter="/"
        keepFormating="true"
        url="${db.url}"
        userid="${db.userid}"
        password="${db.password}">
         <fileset dir="${db.sql.dir}" casesensitive="no">
                 <include name="**/*.sql"/>
         </fileset>
 </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 [mailto:[EMAIL PROTECTED]
> 
> 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
> 

Reply via email to