Ant: sql task: problems with inserts


A

Ana Silver

Hi,

I'm trying to write a target for ant that will invoke all my insert
scripts on a clean database. Here's the ant code:

<target name="database.insert">
<sql driver="org.postgresql.Driver" url="jdbc:postgresql://myhost:5432/
mydatabase"
userid="myuser" password="mypass" encoding="UTF-8" >
<transaction src="db/${db.dir}/dbTerritorialDivision/
voivodships.sql"/>
<transaction src="db/${db.dir}/dbTerritorialDivision/districts.sql"/ <transaction src="db/${db.dir}/dbTerritorialDivision/communes.sql"/>
<transaction src="db/${db.dir}/dbTerritorialDivision/cities.sql"/>
</sql>
</target>

But when I try to execute the target, I get strange error. It seems
like and it adding a question mark before each line and because of
that insert fails.


[sql] Executing resource: D:\eclipseWorkspace\cur\src\db\postgres
\dbTerritorialDivision\voivodships.sql
[sql] SQL: ?INSERT INTO "Voivodships"(voivodship_id,voivodship_name)
VALUES(2,'Dolno¶l±skie')
[sql] Failed to execute: ?INSERT INTO
"Voivodships"(voivodship_id,voivodship_name) VALUES(2,'Dolno¶l±skie')

The .sql file is ok, there are no question marks there.

If somebody could help me to find the solution, I whould be geatefull.

Thanks in advance,
Ana
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top