OHDSI Home | Forums | Wiki | Github

Error when Generating Cohort (SQL query not fully formed)

We have an instance of ATLAS and get an error when generating a cohort (this is using SYNPUF5). Interestingly, or oddly, the table in the error message is pointing to the RESULTS schema when I was expecting it to point to the OHDSI schema, where the COHORT_INCLUSION table exists (but does not get populated). Obviously we have some wires crossed.

"java.lang.RuntimeException: org.springframework.jdbc.BadSqlGrammarException:
PreparedStatementCallback; bad SQL grammar [DELETE FROM RESULTS.cohort_inclusion WHERE cohort_definition_id = ?;];
nested exception is java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended

Any hints on how to debug this? Thanks, Jeff

Could you tell us which SQL you use? (sql server? oracle? or ?)

Looks like oracle, and looks like the trailing ; is the problem. We’ll have to find the part of code that is executing that statement.

@jeffmillstein, could you open an issue on the webapi repo: github.com/ohdsi/webapi?

Thanks @Chris_Knoll. (We are running on Oracle rds 12c). We’re looking to see if we can find were this query is generated. I’ll enter a bug report today. Thanks, Jeff

t