ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Levy Lambert <anto...@gmx.de>
Subject Re: SQl task error - A ? placed at beginning of lines of sql file
Date Wed, 13 Jan 2010 12:49:55 GMT
Hi,

I would think that the bugger here is the "commit;" line.

I think commit is something that the SQL task can do for you.

Regards,

Antoine

mtbvang wrote:
> Removing the "SET FOREIGN_KEY_CHECKS=0" resolved the issue in my create table
> statement. Now I'm getting pretty much the same error in my insert test data
> script. The strange thing is, when I embed this sql between the
> <transaction></transaction> tags it runs, but when I specify a file using
> the src attribute of transaction or sql elements I get the error included
> below. I've modifying the SQL statements and trimming it down to a bare
> minimum of only inserting two not null columns in one table, but no luck
> with the src. Is it something I've over look again?
>
> --
> -- Data for the `certifications` table  (LIMIT 0,500)
> --
>
> INSERT INTO `certifications` (`certification_id`, `provider_id`,
> `verifier_id`, `dateCreated`, `dateVerified`, `certName`, `description`)
> VALUES
>   (60001,20001,20002,'2009-11-01 12:00:00','2009-11-19
> 12:00:00','Cert1','Description of Cert1'),
>   (60002,20004,20002,'2009-11-01 12:00:00','2009-11-19
> 12:00:00','Cert2','Description of Cert1'),
>   (60003,20006,20002,'2009-11-01 12:00:00','2009-11-19
> 12:00:00','Cert3','Description of Cert3'),
>   (60004,20007,20002,'2009-11-01 12:00:00','2009-11-19
> 12:00:00','Cert4','Description of Cert4');
>
> COMMIT;
>
> database.testdata:
>       [sql] Executing resource:
> C:\dev\Projects\ITeezy\MySQL\ITeezy\0.1.0\test-d
> ata.sql
>       [sql] Failed to execute:  ?-- SQL Manager 2007 for MySQL 4.2.0.2
>       [sql]    INSERT INTO `certifications` (`certification_id`,
> `provider_id`,
> `verifier_id`, `dateCreated`, `dateVerified`, `certName`, `description`)
> VALUES
> (60001,20001,20002,'2009-11-01 12:00:00','2009-11-19
> 12:00:00','Cert1','Descript
> ion of Cert1'), (60002,20004,20002,'2009-11-01 12:00:00','2009-11-19
> 12:00:00','
> Cert2','Description of Cert1'), (60003,20006,20002,'2009-11-01
> 12:00:00','2009-1
> 1-19 12:00:00','Cert3','Description of Cert3'),
> (60004,20007,20002,'2009-11-01 1
> 2:00:00','2009-11-19 12:00:00','Cert4','Description of Cert4')
>
> BUILD FAILED
> com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error
> in
> your SQL syntax; check the manual that corresponds to your MySQL server
> version
> for the right syntax to use near '?-- SQL Manager 2007 for MySQL 4.2.0.2
>    INSERT INTO `certifications` (`certifi' at line 1
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>
>      
>
>   


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


Mime
View raw message