Hi There,
I am trying to execute *.sql file containing insert statements using ant
<sql> task onto the DB2 database. The build is failing for me as one of the
insert statement in *.sql has a string description with "--" charters init.

My insert statement looks something like this:

INSERT INTO TableItem (TABLENAME, CODE, DESCRIPTION, ANNOTATION, ISENABLED,
SORTORDER, LOCALEIDENTIFIER, LASTWRITTEN, VERSIONNO) VALUES ('TestTable',
'TT1', 'Common -- Test', '', '1', 0, 'en', CURRENT TIMESTAMP, 1);

And the build error I get:

[sql] Failed to execute: INSERT INTO TableItem (TABLENAME, CODE,
DESCRIPTION, ANNOTATION, ISENABLED, SORTORDER, LOCALEIDENTIFIER,
LASTWRITTEN, VERSIONNO) VALUES ('TestTable', 'TT1000', 'Common -- Test', '',
'1', 0, 'en', CURRENT TIMESTAMP, 1);
[sql] INSERT INTO TableHeader (TableName, TimeEntered, DefaultCode,
LASTWRITTEN, VERSIONNO) VALUES ('TestTable', CURRENT TIMESTAMP, '', CURRENT
TIMESTAMP, 1)
Build Failed:
c:\project\development\EJBServer\bin\app_database.xml:232:
com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -104, SQLSTATE:
42601, SQLERRMC: ('TestTable', 'TT1000', 'Common -- Te;N, VERSIONNO)
VALUES;<space>

But if I execute this insert statement from the DB2 command prompt, it is
getting executed successfully.

Can you please help me in finding the reason for this please?

Cheers,
Pradeep
-- 
View this message in context: 
http://www.nabble.com/Ant-sql-task-fails-while-executing-insert-statement-containg-string-description-with-%22--%22-tp22969153p22969153.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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

Reply via email to