ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anderson, Rob H - VSCM" <Anderson....@vectorscm.com>
Subject RE: creating pl/sql package in sql task, only part of package lo aded
Date Fri, 28 Feb 2003 17:41:31 GMT
The most recent attachement to bug#10719 is the updated sql task with the
functionality described below. 
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10719

Users who care about this, please feel free to get and use this attachment.
If it works for you, let us know. If it doesn't, let us know. 

-Rob Anderson

-----Original Message-----
From: Jose Alberto Fernandez [mailto:jalberto@cellectivity.com]
Sent: Friday, February 28, 2003 9:16 AM
To: Ant Developers List
Subject: RE: creating pl/sql package in sql task, only part of package
lo aded


Rob can you upload your fix as an attachment to the bug?

That way we can try to get it into the code as soon as possible.
Time for those in need of PLSQL support to loby the committers :-)

Maybe we should add an example in the manual on how to set the task to
load PLSQL blocks (just like sqlplus).

Jose Alberto

> -----Original Message-----
> From: Anderson, Rob H - VSCM [mailto:Anderson.Rob@vectorscm.com]
> Sent: 28 February 2003 00:13
> To: 'Ant Developers List'
> Cc: 'riznob@hotmail.com'
> Subject: RE: creating pl/sql package in sql task, only part of package
> lo aded
> 
> 
> 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}"
>                         print="true"
>                         delimiter="/"
>                         delimitertype="row"
>                         keepformat="true"
>                         url="${db.url}"
>                         userid="${db.userid}"
>                         password="${db.password}"
>                         src="${db.sql.src}"
>                 />
>         </target>
> 
> 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 [mailto:jalberto@cellectivity.com]
> 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
> 
> 
> 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:Anderson.Rob@vectorscm.com]
> > 
> > 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: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org

Mime
View raw message