I'm trying to make a request for java (jdbc) on a table that contains $ in the name, and I get an error of invalid sql character.
Is there a way to avoid such errors?
I'm trying to make a request for java (jdbc) on a table that contains $ in the name, and I get an error of invalid sql character.
Is there a way to avoid such errors?
It takes specialized characters '&' (and other special characters) by inserting a '\' before.
But it's the Java compiler! It gives me illegal character usage.
And I can not "Google" for that thing, it ignores the '$' in my research.
In fact, the $ is not a problem in Oracle. If there is one, is it that the Java is something special with $.
Example of SQLPlus:
SELECT * FROM V$DATABASE;
no problem at all.
Another idea, display your request before sending it to Oracle.
Note: lower ('system') = 'system'
Otherwise, I am well before my request, it is correct, but I always have the concerns of char. If I copy / paste in sqlplus, it rolls
Code:Query: select PARENTITEMID from user.DB$17$USERBASE_ATTR where lower(plaintextfragment) = lower('system') java.sql.SQLException:: ORA-00911: invalid character at oracle.jdbc.driver.SQLStateMapping.newSQLException (SQLStateMapping.java:74)
1 - Lower is useless on a string constant already lowercase.
2 - without ';' at the end. The ';' is useful for SQLPlus or PL/SQL to define the commands. But in your context, it is unnecessary.
Bookmarks