This content has been marked as final. Show 3 replies
It is a known limitation of SQL. There are some reserved keywords that cannot be used freely.
Thanks for the explanation. I think it would be better if the SPARQL interpreter captured known Oracle reserved words when trying to execute SPARQL queries. If the interpreter threw an error that said "ORA-00000: Reserved Oracle Keyword found in SPARQL query" then I would realize my mistake. The error "ORA-00936: missing expression" message didn't make much sense when I saw it. I am writing a SPARQL query, not a SQL query. I think people writing SPARQL queries are going to be more focused on what is allowed/disallowed according to the SPARQL specification.
To be honest, I am surprised the SPARQL interpreter allows Oracle keywords. Isn't it a little dangerous to allow the Oracle keywords? According to my error, Oracle was executing the DATE keyword. Doesn't that allow the possibility of something similar to "SQL Injection"? What if I used the keyword DROP, CREATE, etc?
If you put in, unintentionally, some Oracle keywords, then you get an error when query is executed. There is no danger other than it is inconvenient. The same behavior is in a regular SQL select execution. For example,
SQL> select drop from (select 1 "drop" from dual);
select drop from (select 1 "drop" from dual)
ERROR at line 1:
ORA-00936: missing expression
I am logging an enhancement to translate Oracle keywords, for a future Jena Adaptor release.