Reporting SQL data collection error

Its my first time using the reporting module and i’ve been getting pretty stuck on what is the first step sadly.

I have a pretty straight forward table set up in an SQL database called “plantdata”
I can be queried just fine if i do an SQL query on a standard table data binding by a simple:

SELECT * FROM plantdata

However when i try and create a new “Data Source” in my report Data tab, i do the same SELECT ALL query and when i go the the Design tab i get a generic error:

I have no idea what that means, but its rather shocking to me that it cant do a simple select all query.

I’ve noticed everything in reports needs to be linked to a Datasource KEY, but there doesn’t seem to be a way to set up KEYS for Basic SQL queries…? I just want each column name to be a KEY.

Checked the console in gateway and getting the following error related to it:

Time Logger Message

WARN 11:21:54 AM Data [projectName=ReportTest,reportPath=MyReport] Simple Query could not be completed

java.sql.SQLException: Unknown system variable ‘OPTION’
at com.mysql.jdbc.SQLError.createSQLException(
at com.mysql.jdbc.MysqlIO.checkErrorPacket(
at com.mysql.jdbc.MysqlIO.sendCommand(
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(
at com.mysql.jdbc.Connection.execSQL(
at com.mysql.jdbc.Connection.execSQL(
at com.mysql.jdbc.Statement.executeQuery(
at org.apache.commons.dbcp.DelegatingStatement.executeQuery(
at com.inductiveautomation.ignition.gateway.datasource.DelegatingStatement.executeQuery(
at com.inductiveautomation.ignition.gateway.datasource.SRConnectionWrapper$SRStatement.executeQuery(
at com.inductiveautomation.reporting.gateway.ReportingGatewayHook.getReportData(
at com.inductiveautomation.reporting.gateway.ReportingGatewayHook$RPC.getReportData(
at sun.reflect.GeneratedMethodAccessor63.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.inductiveautomation.ignition.gateway.servlets.gateway.functions.ModuleInvoke.invoke(
at com.inductiveautomation.ignition.gateway.servlets.Gateway.doPost(
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
at com.inductiveautomation.ignition.gateway.bootstrap.MapServlet.service(
at org.eclipse.jetty.servlet.ServletHolder.handle(
at org.eclipse.jetty.servlet.ServletHandler.doHandle(
at org.eclipse.jetty.server.handler.ScopedHandler.handle(
at org.eclipse.jetty.server.session.SessionHandler.doHandle(
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(
at org.eclipse.jetty.servlet.ServletHandler.doScope(
at org.eclipse.jetty.server.session.SessionHandler.doScope(
at org.eclipse.jetty.server.handler.ContextHandler.doScope(
at org.eclipse.jetty.server.handler.ScopedHandler.handle(
at org.eclipse.jetty.server.handler.HandlerList.handle(
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
at org.eclipse.jetty.server.Server.handle(
at org.eclipse.jetty.server.HttpChannel.handle(
at org.eclipse.jetty.server.HttpConnection.onFillable(
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
at org.eclipse.jetty.util.thread.QueuedThreadPool$
at Source)[/quote]

I hadn’t seen this error before, but a quick Google search says that it’s coming from using an outdated version of the JDBC driver for your database. Let me know if updating the driver fixes the issue.

When you get the driver working, a query like SELECT * FROM <mytable> will definitely work in reporting. The keys will be made automatically from the data returned by your query. However, if you have column names that are the same as some of the built in keys for reporting (such as “COUNT”, “MAX”, etc) you may want to rename them in your query just to have more consistent results. (ie SELECT count AS mytable_count FROM <mytable>)

Hi Kathy,

Yes updating the JDBC driver to 5.1.40 seems to have worked. Thanks
Now i just gotta figure out why timestamp filtering works in a normal table query but not a Reporting datasource query… :scratch:

The above timestamp filter issue was solved by using an “SQL Query” instead of the “Basic SQL query” data source in the reporting module.