ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chandu" <cha...@translogicsys.com>
Subject Re: Commenting sql statments - required support from Ant
Date Wed, 14 Apr 2004 14:05:58 GMT
Ivan,

Thanks!!! It worked.
But one doubt. We are pre-processing the scripts to remove the comments, and
doing SQLExec task's
built in functionality(stripping comments). But it is nice if Ant allows to
have the configurability of comment string
in the sql scripts.

Anyway, it worked fine for me. Thanks again.

----- Original Message ----- 
From: "Ivan Ivanov" <rambiusparkisanius@yahoo.com>
To: "Ant Users List" <user@ant.apache.org>
Sent: Wednesday, April 14, 2004 1:53 PM
Subject: Re: Commenting sql statments - required support from Ant


>
> > Hi all,
> >
> > I am executing an sql file as follows:
> >
> > <sql userid="${USERNAME}" password="${PASSWORD}"
> > url="${CONNECTSTRING}"
> > driver="${DRIVER}"
> > autocommit="true" src="mysql-dump.sql">
> > </sql>
> >
> > With the above snippet of code I tried to execute a
> > mysql dump file. It gave
> > an sql fail error. Ant ignores
> > lines starting with -- or // or REM words. But mysql
> > dump file contains # as
> > comments. Now I wanted to
> > tell the ant that "ignore the lines starting with
> > this particular character
> > or word". Is there any way to do?
>
> Yes there is. Here is the snippet:
>
>         <copy todir="${project.dist.dir}/sql">
>             <fileset dir="${basedir}/sql">
>                 <include name="create.sql"/>
>                 <include name="insert.sql"/>
>             </fileset>
>             <filterchain>
>                 <striplinecomments>
>                     <comment value="#"/>
>                 </striplinecomments>
>             </filterchain>
>         </copy>
>
> The important work is done with the nested filterchain
> in the copy task [2]: The Copy task supports nested
> FilterChains (from [1]).
>
> Hope this helps
> Ivan
>
> [1]http://ant.apache.org/manual/CoreTasks/copy.html
> [2]http://ant.apache.org/manual/CoreTypes/filterchain.html
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Tax Center - File online by April 15th
> http://taxes.yahoo.com/filing.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org


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


Mime
View raw message