ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Magesh Umasankar" <umag...@apache.org>
Subject Re: [patch] added file reference capability to SQL task
Date Wed, 20 Mar 2002 16:46:51 GMT
----- Original Message ----- 
From: "Tim Dawson" <tim.dawson@notiva.com>
To: <jakarta-ant-dev@apache.org>
Sent: Friday, March 08, 2002 11:36 AM
Subject: [patch] added file reference capability to SQL task


> This patch adds the capability to have a SQL file reference another
> file. Rather than relying on a nested FileSet that has no specified
> order, you can specify a sql file that will refer to the files one at a
> time, e.g. 
> 
> -- foo.sql --
> select * from foo;
> @bar.sql
> @baz.sql
> 
> -- bar.sql --
> select * from bar;
> 
> -- baz.sql --
> select * from baz;
> 
> will execute 
> select * from foo;
> select * from bar;
> select * from baz;
> 
> I made this change to the <sql> task because our DBA had been using this
> approach for sql files run from SQLPLUS and I wanted to be able to
> automate that process with Ant so it could be part of our auto-build.
> (plus I didn't want to install the SQL client on our build box)
> 
> If the sql being executed comes from a file, and the file references are
> relative, I made them relative to the original file, not the JVM's
> current directory, which seemed like it would be a little easier to
> maintain.
> 

Just out of curiosity:
Is this a standard way to write sql files?
I mean do tools other than SqlPlus recognize
statements starting with @ as file references?

Comments on the patch:

* Shouldn't the srcFile != null check actually be subFile != null?

* Missing documentation

* Missing testcases

Please resubmit with these included in the patch.

> Tim Dawson

Cheers,
Magesh

******************************************************
*  Experience: The name men give to their mistakes.  *
******************************************************



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


Mime
View raw message