Read and execute multiple sql statements from a single file
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   R_Rodrigues
Posted On:   Tuesday, September 30, 2003 03:52 PM

Hi this is a newbiee question . What I am atrying to do is read from a sql file that has s list of sql files to be executed and if a specific file fails log it . It look something like javaexec.sql test1.sql test2.sql I am able to see the test1.sql and test2.sql and can connect to the database But when I use the foreach to execute each sqlfile I get an error from ANT. ** file:C:/ant/bin/build.xml:10: Could not create task or type of type: foreach. I am confused as to what has happened cause when I use the echo parameter I can see test1.sql and test2.sql I have another question, I have 2 tasks LOADSQLFile ExecuteSQLFile In my ExecuteS   More>>

Hi this is a newbiee question .

What I am atrying to do is read from a sql file that has s list of sql files to be executed and if a specific file fails log it . It look something like
javaexec.sql
test1.sql
test2.sql

I am able to see the test1.sql and test2.sql and can connect to the database

But when I use the foreach to execute each sqlfile I get an error from ANT.
**
file:C:/ant/bin/build.xml:10: Could not create task or type of type: foreach.

I am confused as to what has happened cause when I use the echo parameter I can see test1.sql and test2.sql

I have another question, I have 2 tasks
LOADSQLFile
ExecuteSQLFile

In my ExecuteSQLFile task I have the sql

driver="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@localhost:1521:cmrs"
userid="cmrs"
password="cmrs"
print="yes"
output="result.log"
onerror="continue"
>
which connects to the database is there a way that I can do it once rather than call it everytime in my execute each sqlfile from the foreach statement in the LOADSQLFile task ?


This is what I have done so far, any suggestion
Thank you





${SQLfiles}







driver="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@localhost:1521:cmrs"
userid="cmrs"
password="cmrs"
print="yes"
output="result.log"
onerror="continue"
>



   <<Less

Re: Read and execute multiple sql statements from a single file

Posted By:   R_Rodrigues  
Posted On:   Tuesday, September 30, 2003 05:05 PM

oops!! sorry the above file is a little older , this is the current one I am working on

































${SQLfiles}









${file}


driver="oracle.jdbc.driver.OracleDriver"

url="jdbc:oracle:thin:@192.168.4.9:1521:cmrs"

userid="cmrs"

password="cmrs"

print="yes"

output="result.log"

onerror="continue"

>










The Foreach statement cant be found I really dont knwo why I placed it in my
c:antlib directory and have it set in my classpath and have speicifally in the build.xml file mentioned it is there something wrong i did ???
About | Sitemap | Contact