OHDSI / CohortGenerator

An R package for instantiating cohorts using data in the CDM.
https://ohdsi.github.io/CohortGenerator/
11 stars 10 forks source link

CohortStats export fails on Oracle #96

Closed anthonysena closed 2 months ago

anthonysena commented 1 year ago

See here:

https://github.com/OHDSI/CohortGenerator/blob/30fe75d61cc8414f6021786502410fe7f66a3ac2/R/CohortStats.R#LL156C81-L156C81

The resulting SQL fails in Oracle when specifying the databaseId parameter. Instead of this SQL

SELECT CAST('1493204081' as VARCHAR(255)) as database_id, * FROM schema.INCLUSION_RESULT;

It should be

SELECT CAST('1493204081' as VARCHAR(255)) as database_id, t.* FROM schema.INCLUSION_RESULT t;

Note the table alias is required when using * in the select with another column