ORA-00911, "911" looking at the very domineering error number, although I am still a beginner of Oracle, but each encounter an unseen ora error number, there is a case of bright, according to the error number, OERR, related error information, determine the cause of the error and find a solution or alternative, Although most may still refer to the predecessor or the official, but encountered once, at least familiar with, once again encountered even if do not remember, probably can have a direction.
Again, this ORA-00911 error was encountered in a test case written in Java,
...
private static final String sql_insert_tbl = "INSERT into TBL (ID, ...)"
+ "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, sysdat E, sysdate); ";
It is reported that this SQL has this error.
Look at the error description:
ORA-00911 Invalid character
Cause:special characters is valid only in certain places. If special characters other than $, _, and # were used in a name and the name was not enclosed in double quotation marks (") , this message would be issued. One exception to this rule was for database names; In this case, double quotes is stripped out and ignored.
Action:remove the invalid character from the statement or enclose the object name in double quotation marks.
Obviously, this error is mainly due to the SQL contains illegal characters, parsing error occurs.
But this SQL is very simple Ah, is an INSERT statement, copy him to Plsql developer seems to be possible ah, strange.
Commissioning many times, suddenly found that the definition of the end of a ";", is this the problem?
So first in the Plsql developer execution INSERT statement, the end with two ";", and indeed reported this ORA-00911 error.
To modify a statement in the code:
private static final String sql_insert_tbl = "INSERT into TBL (ID, ... ) "
+ "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, sysdat E, Sysdate) ";
Sure enough, the normal echo.
A seemingly simple, but wrong to pick a more troublesome mistake, worth their own summary.
1. Oerr error description is the benchmark, to follow this direction, the basic direction can be clear .
2. SQL errors in the code can be re-executed in tools such as Plsql developer to simulate errors, but be sure to do the same with the SQL statements in the code, where I may not have an ending when I copy it, so that the first time I do not find this error, in a word, In addition to the need to judge the general direction, the most important thing is to be careful, do not let go of any small details .
can refer to Yangchang old once encountered this ORA-00911 error: http://blog.itpub.net/4227/viewspace-68615/
ORA-00911 Error