I'm trying to add Oracle support to a tool designed to populate a schema for a given containerized database. The tool relies on a .sql script which is processed through ResourceDatabasePopulator.
The problem I'm facing is this well-established schema has several tables with columns named "KEY." I would love to simply fix the name of these columns but cannot do so.
The script itself escapes these column names well enough to run through sqlplus:
CREATE TABLE sys_config {
ID NUMBER(19) not null,
...
'KEY' varchar(255),
PRIMARY KEY ID
);
However, when this DDL is processed, the following error occurs:
[latest.sql]: create table sys_config ( ID number(19) not null, CFG_ID number(19), 'KEY' varchar2(255), VAL varchar2(255), primary key (ID) );
nested exception is java.sql.SQLSyntaxErrorException: ORA-00904: : invalid identifier
I've tried escaping the name in the following ways:
`KEY`
'`'KEY'`'
`'`KEY`'`
\'KEY\'
But keep running into either this "invalid identifier" error or an "invalid character" error.
Is there a way I can escape this column name that ResourceDatabasePopulator will support and still create these columns?