Today, I encountered a problem when writing SQL statements to query ORACLE data. The SQL statements written in the general SQL query analyzer (running everything normally) are thrown to the SQL statements written in C #. Program. Error CodeAs follows:
System. Data. oledb. oledbexception: one or more errors occurred during processing of command.
ORA-00911: Invalid character...
After checking for half a day, I did not find any cause of SQL errors (I suspected it was a problem with character transcoding, but I finally got rid of it). Finally, I found the answer online, it turns out "it's a semicolon "!
I generally like to add ":" at the end of each statement when writing SQL. I think this is also the habit of programmers who generally write SQL. Because many SQL queries and analysis at the time will regard this semicolon as the end of a statement. However, in actual execution, the semicolon cannot be thrown into the Oracle parser, because the Oracle syntax parser is very strict and the above error will be reported, the solution is also simple. Remove the semicolon.
The above problems apply to any Oracle Data Queries written in a program, and sometimes seem to get used to killing people.
Note:
I use the OCI interface in C language to call SQL statements. A semicolon is added at the end of the SQL statement.
Error code:911
Error description:ORA-00911: Invalid character.