nimblenik
nimblenik

Reputation: 11

logging in ant script for running .sql

I have a .sql file which contain create script for 20 tables.I am running this through ant.

the Ant Script is

<target name="CompleteDBRollCreate" >
        <sql classpath="D:\lib\ojdbc14.jar"      driver="oracle.jdbc.driver.OracleDriver"     
        url="jdbc:oracle:thin:@12326:1521:orcl"      
        userid="scott"      password="tiger"    
        src="D:\dropalltables.sql"  /> 
        </target>

but there is no logging in ant so I can't know if the SQL file was executed correctly. Can any one please suggest how to do logging into a separate localfile/on the ant console. I just want to know where I need to change the .sql file or the ant script.

Upvotes: 1

Views: 1493

Answers (2)

janarde
janarde

Reputation: 115

-logfile will give you jdbc jdbc exceptions and all the noise around that, which can be useful, but I would also recommend spooling in the sql file as well as it looks like you are going to have multiple statements in the script. So I'd say you should use the -logfile option and also alter your script to spool any ORA errors you might encounter if you have multiple statements.

spool test.out
create table foo (testCol varchar2(2));

drop table foo;

spool off

Upvotes: 1

Mutation Person
Mutation Person

Reputation: 30520

There is logging in ant. Check out Running Apache Ant - Command Line:

-logfile use given file for log

Upvotes: 2

Related Questions