Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

SQL files execute : Incorrect syntax near ‘go’.

saiki created the topic: SQL files execute : Incorrect syntax near ‘go’.
Getting below issue when trying to run the ant script.

I am trying to run few sql files from the folder through ant script in which I configured the “jtds-1.2.5.jar”.
Unable to run the GO statment in the sql file. But able to execute same file it through sql studio with out any error.

************************************************** **


************************************************** **
ERROR:
************************************************** **
java.sql.SQLException: Incorrect syntax near ‘go’.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnos tic(SQLDiagnostic.java:368)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(Td sCore.java:2820)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCor e.java:2258)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(T dsCore.java:632)
at net.sourceforge.jtds.jdbc.JtdsStatement.processRes ults(JtdsStatement.java:584)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL (JtdsStatement.java:546)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeImp l(JtdsStatement.java:723)
at net.sourceforge.jtds.jdbc.JtdsStatement.execute(Jt dsStatement.java:1160)
at org.apache.tools.ant.taskdefs.SQLExec.execSQL(SQLE xec.java:775)
at org.apache.tools.ant.taskdefs.SQLExec.runStatement s(SQLExec.java:751)
at org.apache.tools.ant.taskdefs.SQLExec$Transaction. runTransaction(SQLExec.java:1055)
at org.apache.tools.ant.taskdefs.SQLExec$Transaction. access$000(SQLExec.java:985)
at org.apache.tools.ant.taskdefs.SQLExec.execute(SQLE xec.java:653)

rajeshkumar replied the topic: Re: SQL files execute : Incorrect syntax near ‘go’.
ave you tried executing sql statement on command line. may be sql studio has some setting which is helping to get it execute but not the ant script.

please refer these url as well…
forums.oracle.com/forums/thread.jspa?threadID=1323298
stackoverflow.com/questions/6614544/how-…on-using-jdbc-driver
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

saiki replied the topic: Re: SQL files execute : Incorrect syntax near ‘go’.
I Have set delimetr to GO in ant script

Then it worked

Rajesh Kumar
Follow me
Latest posts by Rajesh Kumar (see all)
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x