ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <vinod.na...@iflexsolutions.com>
Subject RE: war deploy
Date Wed, 12 May 2004 09:30:50 GMT
Hi Ivan,

This is the change I did.

For procedures we need to use the delimiter "/" and for other SQL scripts 
we have to use ";" delimiter[which is default value]

     <target name="db-procs" description="Re-Compiles a procedure">
         <sql driver="${jdbc.mysql.driver}"
             classpathref="jdbc.driver.cp"
             url="${install.dburl}"
             userid="" password="" delimiter="/">
             <transaction src="procedure.sql"/>
         </sql>
     </target>

Regards,
Vinod.


-----Original Message-----
From: Ivan Ivanov [mailto:rambiusparkisanius@yahoo.com]
Sent: Wednesday, May 12, 2004 2:50 PM
To: Ant Users List
Subject: RE: war deploy


Hi Vinod,

And how does your <sql> tasks look line now?

--- vinod.nayak@iflexsolutions.com wrote:
> Hi Ivan,
> 
> It worked fine when I used delimiter option in SQL
> task.
> 
> Thanks!
> 
> -----Original Message-----
> From: Vinod Rama Nayak-OP 
> Sent: Wednesday, May 12, 2004 11:37 AM
> To: user@ant.apache.org
> Subject: RE: war deploy
> 
> 
> Hi Ivan,
> 
> I modified the sql task as you suggested.
> 
>     <target name="initdb" description="Re-Compiles a
> procedure">
>         <sql driver="${jdbc.mysql.driver}"
>             classpathref="jdbc.driver.cp"
>             url="${install.dburl}"
>             userid="" password=""
>             keepformat="true">
>             <transaction src="procedure.sql"/>
>         </sql>
>     </target>
> 
> This is the error i get without verbose option.
> 
> db-update:
>      [echo] Applying db patches.
>       [sql] Executing file:
> /products/proj/pisars/dist/db/procedures.sql
>       [sql] Failed to execute:
>       [sql]
>       [sql] CURSOR cur_sla IS SELECT
> system_name,sla_param FROM
> REPORT_QUALITY_METRICS_DATA
>       [sql] WHERE auto_key=AutoKey AND
> system_name<>'CITIDIRECT'
> 
> BUILD FAILED
> /products/proj/pisars/dist/build.xml:361:
> java.sql.SQLException: ORA-00900: invalid SQL
> statement
> 
> 
> and this is with verbose -v option.
> 
> db-update:
>      [echo] Applying db patches.
>       [sql] connecting to
> jdbc:oracle:thin:@<oracle-host>:<port>:<sid>
>       [sql] Loading oracle.jdbc.driver.OracleDriver
> using AntClassLoader with classpath
> /products/bea/610sp5/wlserver6.1/lib/cla
> sses12.jar
>       [sql] Executing file:
> /products/proj/pisars/dist/db/procedures.sql
>       [sql] SQL:
>       [sql] CREATE OR REPLACE PROCEDURE
> SP_WEEKLY_QUALITY_METRICS(
>       [sql]     start_date IN VARCHAR2,
>       [sql]     date_format IN VARCHAR2,
>       [sql]     HOLIDAYS IN VARCHAR2,
>       [sql]     AutoKey IN VARCHAR2) IS
>       [sql]
>       [sql] rep_start_date DATE :=
> TO_DATE(start_date,date_format)
>       [sql] 0 rows affected
>       [sql] SQL:
>       [sql]
>       [sql] CURSOR cur_sla IS SELECT
> system_name,sla_param FROM
> REPORT_QUALITY_METRICS_DATA
>       [sql] WHERE auto_key=AutoKey AND
> system_name<>'CITIDIRECT'
>       [sql] Failed to execute:
>       [sql]
>       [sql] CURSOR cur_sla IS SELECT
> system_name,sla_param FROM
> REPORT_QUALITY_METRICS_DATA
>       [sql] WHERE auto_key=AutoKey AND
> system_name<>'CITIDIRECT'
> 
> BUILD FAILED
> /products/proj/pisars/dist/build.xml:361:
> java.sql.SQLException: ORA-00900: invalid SQL
> statement
> 
>         at
>
org.apache.tools.ant.taskdefs.SQLExec.execute(SQLExec.java:403)
>         at
>
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
>         at
> org.apache.tools.ant.Task.perform(Task.java:364)
>         at
> org.apache.tools.ant.Target.execute(Target.java:301)
>         at
>
org.apache.tools.ant.Target.performTasks(Target.java:328)
>         at
>
org.apache.tools.ant.Project.executeTarget(Project.java:1215)
>         at
>
org.apache.tools.ant.Project.executeTargets(Project.java:1063)
>         at
> org.apache.tools.ant.Main.runBuild(Main.java:632)
>         at
> org.apache.tools.ant.Main.startAnt(Main.java:183)
>         at
> org.apache.tools.ant.Main.start(Main.java:147)
>         at
> org.apache.tools.ant.Main.main(Main.java:230)
> --- Nested Exception ---
> java.sql.SQLException: ORA-00900: invalid SQL
> statement
> 
> -----Original Message-----
> From: Ivan Ivanov
> [mailto:rambiusparkisanius@yahoo.com]
> Sent: Tuesday, May 11, 2004 9:47 PM
> To: Ant Users List
> Subject: RE: war deploy
> 
> 
> Hi, Vinod,
> can you tell me what db you are using and how
> exactly
> your procedure fails. Also did you try starting ant
> with verbose -v option? What does it output?
> 
> --- vinod.nayak@iflexsolutions.com wrote:
> > Thanks for your reply.
> > 
> > Actually there are absolutely no comments in the
> > file.
> > if the procedure.sql is a collection db
> > insert/update statements
> > it works fine. but if it is a db procedure it
> fails.
> > 
> > Rgds,
> > Vinod
> > 
> > -----Original Message-----
> > From: Ivan Ivanov
> > [mailto:rambiusparkisanius@yahoo.com]
> > Sent: Tuesday, May 11, 2004 6:52 PM
> > To: Ant Users List
> > Subject: RE: war deploy
> > 
> > 
> > Hi Vinod,
> > 
> > I also had small difficulties with <sql> task -
> > syntactically correct statements were not
> executed.
> > The problem was fixed when I removed sql comments
> > from
> > my *.sql files. You can try these:
> > - remove comments from your sql files with
> > <striplinecomments>
> > - add keepformat="yes" attribute to <sql> task
> > HTH
> > Ivan
> > 
> > P.S. There was some discussion in the list about
> > comment symbols in sql files and ant developers
> > opened
> > bug 'Add "commentchars" attribute to Sql task'
> >
>
(http://nagoya.apache.org/bugzilla/show_bug.cgi?id=28394)
> > If you want you can vote for this.
> > 
> > 
> > --- vinod.nayak@iflexsolutions.com wrote:
> > > Hi All,
> > > 
> > > I have similar task like this in my build.xml
> > > 
> > >     <target name="initdb"
> description="Re-Compiles
> > a
> > > procedure">
> > >         <sql driver="${jdbc.mysql.driver}"
> > >             classpathref="jdbc.driver.cp"
> > >             url="${install.dburl}"
> > >             userid="" password=""
> > >             print="yes">
> > >             <transaction src="procdure.sql"/>
> > >         </sql>
> > >     </target>
> > > 
> > > Though the procedure successfully gets compiled
> in
> > > the SQL plus window
> > > it does not through this Ant task.
> > > 
> > > Am I missing anything here.
> > > It gives the SQL error at CURSOR declaration of
> 
=== message truncated ===



	
		
__________________________________
Do you Yahoo!?
Yahoo! Movies - Buy advance tickets for 'Shrek 2'
http://movies.yahoo.com/showtimes/movie?mid=1808405861 

---------------------------------------------------------------------
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