I tried to execute an SQL
INSERT
with Toad for oracle
:
INSERT INTO GRAT_ACTIVITY
(UUID, IP_ADRESS, SEND_MAIL, DATE_
The statement you're executing is valid. The error seems to mean that Toad is including the trailing semicolon as part of the command, which does cause an ORA-00911
when it's included as part of a statement - since it is a statement separator in the client, not part of the statement itself.
It may be the following commented-out line that is confusing Toad (as described here); or it might be because you're trying to run everything as a single statement, in which case you can try to use the run script command (F9) instead of run statement (F5).
Just removing the commented-out line makes the problem go away, but if you also saw this with an actual commit then it's likely to be that you're using the wrong method to run the statements.
There is a bit more information about how Toad parses the semicolons in a comment on this related question, but I'm not familiar enough with Toad to go into more detail.
The option(s) to resolve this Oracle error are:
Option #1 This error occurs when you try to use a special character in a SQL statement. If a special character other than $, _, and # is used in the name of a column or table, the name must be enclosed in double quotations.
Option #2 This error may occur if you've pasted your SQL into your editor from another program. Sometimes there are non-printable characters that may be present. In this case, you should try retyping your SQL statement and then re-execute it.
Option #3 This error occurs when a special character is used in a SQL WHERE clause and the value is not enclosed in single quotations.
For example, if you had the following SQL statement:
SELECT * FROM suppliers WHERE supplier_name = ?;
I had the same problem and it was due to the end of line. I had copied from another document. I put everythng on the same line, then split them again and it worked.
I'm using a 3rd party program that executes Oracle SQL and I encountered this error. Prior to a SELECT
statement, I had some commented notes that included special characters. Removing the comments resolved the issue.
I encountered the same thing lately. it was just due to spaces when copying a script from a document to sql developer. I had to remove the spaces and the script ran.
Remove the semicolon ( ; ).
In oracle, you can use semicolon or not when u ran query directly on DB. But when u using java to ran a oracle query, u have to remove semicolon at the end.