OHDSI Home | Forums | Wiki | Github

Cohort Creation failed Bad SQL Grammar All Commands work when run individually

When trying to create a cohort the user gets a failed error message.
The first error message says:
rg.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar
Then goes on to list the sql code used to generate the cohort.

There are two other error messages:
Call getNextException to see the cause.
as well as:
java.sql.BatchUpdateException: Batch entry 2

After looking on the forums one recommendation is to export the SQL and run it all individually, this was done and all the commands worked as expected and the cohort with the correct ID can be found in the cohort table.

Any help or other information would be greatly appreciated.

Best,
Alex

Usually after the sql dump, it will give you a more specific error message, such as ‘permission denied’.

Thanks for the reply.

In the log files?
And what do you mean by the sql dump? Ie. when the script commits the transaction to the server?

The logs don’t seem to say anything about permission denied so am confused.

Thanks
Alex

By ‘log files’ I mean that: if you host the WebAPI .war in tomcat, there is a /logs folder under the installation directory, for example. I’m not sure how you are hosting/running your WebAPI.

By SQL dump, I mean that in the log file, you’ll see a similar error message as you do in the Atlas UI, but in the log file, you get more detail. You may be able to find additional information as to why the call failed.

The ‘permission denied’ was just an example of an error you might see. I think, based on your second statement, that you found the logs and you didn’t find anythign related to permission denied, but did you find anything about the specific error you encountered? Sometimes it is easier to stop the service, delete all the logs, and start it up and try to trigger the error immediately so that it is easier to find in the logs…

t