Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Data Source Use last rundatetime Checkbox issue while loading data

priyanshp4
Tera Contributor

We are getting data using JDBC with specific SQL query but while using last run datetime it is throwing error meanwhile same query works fine when it is disabled.

 

Error: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'ORDER'.

1 ACCEPTED SOLUTION

priyanshp4
Tera Contributor

Only thing was to remove semicolon from the SQL query...

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron

@priyanshp4 

please share screenshots

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Error:

MID Server reported error: SQLState: S0001
com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'ORDER'.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:262)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1624)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:868)
at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:768)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7194)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2979)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:248)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:223)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(SQLServerStatement.java:693)
at com.service_now.monitor.jdbc.JDBCRowSet.query(JDBCRowSet.java:66)
at com.service_now.mid.probe.JDBCProbe.doSelect(JDBCProbe.java:487)
at com.service_now.mid.probe.JDBCProbe.doQuery(JDBCProbe.java:349)
at com.service_now.mid.probe.JDBCProbe.probe(JDBCProbe.java:236)
at com.service_now.mid.probe.AProbe.process(AProbe.java:160)
at com.service_now.mid.queue_worker.AWorker.runWorker(AWorker.java:187)
at com.service_now.mid.queue_worker.AWorkerThread.run(AWorkerThread.java:20)
at com.service_now.mid.threadpool.ResourceUserQueue$RunnableProxy.run(ResourceUserQueue.java:643)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)

Also , does it support CTE query?

 

priyanshp4_1-1789117083813.png

 

 

priyanshp4
Tera Contributor

Only thing was to remove semicolon from the SQL query...