In grails 4.1.0 function sql.rows converting tablename in caps
21 views
Skip to first unread message
Prince Mishra
unread,
Jul 28, 2023, 6:03:30 AM7/28/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Grails Dev Discuss
Hey guys
I'm trying to update my project from grails 3.3.9 to 4.1.0, then I encountered a runtime exception I'm using groovy.sql.Sql function sql.rows to perform some database operations like select * from location but when my program starts and the above line executes it says that there is no table for 'LOCATION' and inn mysql DB the table name is location .
I'm not sure why this happening
here is the complete Exception i'm getting
getting this error while upgrading the grails app from 3.3.9 to 4.1.0
org.quartz.JobExecutionException: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "LOCATION" not found; SQL statement:
select * from location where netnum > -1 and lat_long_status = 0 limit 100 [42102-199]
at grails.plugins.quartz.GrailsJobFactory$GrailsJob.execute(GrailsJobFactory.java:111)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "LOCATION" not found; SQL statement:
select * from location where netnum > -1 and lat_long_status = 0 limit 100 [42102-199]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:451)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:427)
at org.h2.message.DbException.get(DbException.java:205)
at org.h2.message.DbException.get(DbException.java:181)
at org.h2.command.Parser.readTableOrView(Parser.java:7146)
at org.h2.command.Parser.readTableFilter(Parser.java:1895)
at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:2641)
at org.h2.command.Parser.parseSelectSimple(Parser.java:2788)
at org.h2.command.Parser.parseSelectSub(Parser.java:2636)
at org.h2.command.Parser.parseSelectUnion(Parser.java:2469)
at org.h2.command.Parser.parseSelect(Parser.java:2440)
at org.h2.command.Parser.parsePrepared(Parser.java:814)
at org.h2.command.Parser.parse(Parser.java:788)
at org.h2.command.Parser.parse(Parser.java:760)
at org.h2.command.Parser.prepareCommand(Parser.java:683)
at org.h2.engine.Session.prepareLocal(Session.java:627)
at org.h2.engine.Session.prepareCommand(Session.java:565)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1292)
at org.h2.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:78)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:114)
at com.sun.proxy.$Proxy107.executeQuery(Unknown Source)
at groovy.sql.Sql$QueryCommand.runQuery(Sql.java:4740)
at groovy.sql.Sql$AbstractQueryCommand.execute(Sql.java:4654)
at groovy.sql.Sql.rows(Sql.java:1764)
at groovy.sql.Sql.rows(Sql.java:1681)
at groovy.sql.Sql$rows.call(Unknown Source)
at lizard.LocationService.setLocationLatAndLong(LocationService.groovy:4765)
at lizard.LocationService$setLocationLatAndLong$2.call(Unknown Source)
at lizard.LocationLatLngJob.execute(LocationLatLngJob.groovy:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at grails.plugins.quartz.GrailsJobFactory$GrailsJob.execute(GrailsJobFactory.java:104)