I am using JOOQ With Oracle 19. In running a Simple query, it is giving invalid character below. Not sure why its creating quotes ‘ either. Java and stack trace SQL below. How can this be fixed for a simple query? It compiles fine however it running produces error.
Java:
Result<Record1<BigInteger>> test = create.select(PRODUCT.PRODUCT_ID) .from(PRODUCT) .where(PRODUCT.STATUS.eq("submitted")).fetch();
Console Log
SQL [select `HEALTHCARE`.`PRODUCT`.`PRODUCT_ID` from `HEALTHCARE`.`PRODUCT` where `HEALTHCARE`.`PRODUCT`.`STATUS` = ? -- SQL rendered with a free trial version of jOOQ 3.15.2]; ORA-00911: invalid character
I copied the SQL query into Oracle SQL Execution Runner, removed the quotes and it works. So not sure what the issue is.
Update:
For Oracle 19, should I use Oracle or Oracle 18C?
Advertisement
Answer
You seem to be using the SQLDialect.MYSQL
dialect, instead of the SQLDialect.ORACLE
one, which explains the backticks in your SQL string.