I am running Achilles Analysis in linux machine but i am getting errors while running it i am giving the errorReport details below and i am facing same issue while trying to run it for impala too
DBMS:
oracle
Error:
java.sql.SQLSyntaxErrorException: ORA-00911: invalid character
ORA-06512: at line 7
SQL:
BEGIN
EXECUTE IMMEDIATE ‘TRUNCATE TABLE #.nrvbeomgs_tmpach_Drug_cost_raw’;
EXECUTE IMMEDIATE ‘DROP TABLE #.nrvbeomgs_tmpach_Drug_cost_raw’;
EXCEPTION
WHEN OTHERS THEN
IF SQLCODE != -942 THEN
RAISE;
END IF;
END;
SqlRender should have removed # from the oracle temp table names. I’m pretty sure we have sqlRender test cases for dealing with temp tables. @Ajit_Londhe, do you recognize this query from the Achilles analysis? It looks related to the cost tables, but not sure if that’s something from 5.3 or 6.0?
Tagging @pavgra and @gregk for input on the question on Impala.
ccaeRes <- achilles(connectionDetails = omopConn,
cdmDatabaseSchema = “omop_cdm”,
resultsDatabaseSchema = “omop_cdm”,
vocabDatabaseSchema = “omop_cdm”,
sourceName = “OMOP CDM”,
cdmVersion = “5.0”,
runHeel = TRUE,
runCostAnalysis = TRUE,
dropScratchTables = TRUE, // i added this option to drop scratch tables as per Achilles documentation
createTable = TRUE) // i added this option to drop scratch tables as per Achilles documentation
For both v5 and v5+ we derive two cost staging tables, one for drug, one for procedure, before doing any of the cost analyses. So these commands are expected, just the table prefix is incorrect causing the error. Using 1 thread, all staging tables should be temp tables, and the table prefix shouldn’t be “#.”
When I debug with a dummy Oracle connection like the one you posted, I get these SQL commands:
[[1]]
[1] "BEGIN\n EXECUTE IMMEDIATE 'TRUNCATE TABLE zue6skxns_tmpach_Drug_cost_raw';\n EXECUTE IMMEDIATE 'DROP TABLE zue6skxns_tmpach_Drug_cost_raw';\nEXCEPTION\n WHEN OTHERS THEN\n IF SQLCODE != -942 THEN\n RAISE;\n END IF;\nEND;"
[[2]]
[1] "BEGIN\n EXECUTE IMMEDIATE 'TRUNCATE TABLE zue6skxns_tmpach_Procedure_cost_raw';\n EXECUTE IMMEDIATE 'DROP TABLE zue6skxns_tmpach_Procedure_cost_raw';\nEXCEPTION\n WHEN OTHERS THEN\n IF SQLCODE != -942 THEN\n RAISE;\n END IF;\nEND;"
Those appear to be valid. Can you try calling dropAllScratchTables directly?
@Ajit_Londhe I am using dropScratchTables = TRUE parameter in Achilles analysis to drop scratch tables and if i want to drop scratch tables manually how can i figure out some table is scratch table?. @Chris_Knoll I created a new scheme for results database but still getting the below error
Error:
java.sql.SQLSyntaxErrorException: ORA-00911: invalid character
ORA-06512: at line 7
SQL:
BEGIN
EXECUTE IMMEDIATE ‘TRUNCATE TABLE #.weqw0rois_tmpach_Drug_cost_raw’;
EXECUTE IMMEDIATE ‘DROP TABLE #.weqw0rois_tmpach_Drug_cost_raw’;
EXCEPTION
WHEN OTHERS THEN
IF SQLCODE != -942 THEN
RAISE;
END IF;
END;
The problem is that the table name in the ‘TRUNCATE TABLE’ statement starts with #, which is an invalid character in Oracle. For some reason, when the query was translated from the ‘default sql dialect’ into ‘oracle’, it didn’t identify the temp table with a # and strip the character.
There is a bug somewhere in the translation of this statement from OHDSI SQL to Oracle Sql.
@rahulbujji45, although you are specifying to drop scratch tables in the function call to achilles(), it would help in gathering more information if you could call the function dropAllScratchTables() directly. Although the temp table prefix Oracle generates is random, I’m curious to see if the mis-translation is consistent.
@Ajit_Londhe sorry for asking the basic question i am newbie to OHDSI how can i call dropAllScratchTables() form the Achilles. Can you please point to some documentation how to use this function.
Hi @Ajit_Londhe i uninstalled the Achilles currently in my system and installed devtools::install_github(“OHDSI/Achilles”, ref = “oraclefixes”) but when i try to run Achilles Analysis i am getting below error
Error in SqlRender::loadRenderTranslateSql(sqlFilename = file.path(“analyses”, :
object ‘oracleTempSchema’ not found
I tried with even setting oracleTempSchema=Tempccaetable but still i am getting database not found.
@Ajit_Londhe can you please suggest me how can i over come the error or in SqlRender::loadRenderTranslateSql(sqlFilename = file.path(“analyses”, :
object ‘oracleTempSchema’ not found if i am using package “oraclefixes”.
Hi,
We recently attempted to upgrade the Achilles code (we use Oracle 12) and are getting the same error mentioned in this post. I see in the last statement that some fixes had been pushed. However, we pulled from the most recent branch and are getting the error. Was there a final solution that has not been added to this thread?