Low severitysql
Oracle Database Error:
ORA-00911
What does this error mean?
The SQL statement contains a character that is not valid at its position — most commonly a trailing semicolon when SQL is passed via JDBC, or a null byte in a dynamically built query.
Common causes
- 1Trailing semicolon in SQL passed via JDBC (Oracle JDBC driver rejects it)
- 2NULL byte or non-printable character in dynamically built SQL
- 3Copy-paste from a rich text editor introduced a non-ASCII character
- 4SQL script designed for SQL*Plus (which accepts semicolons) run via JDBC
How to fix it
- 1Step 1: Remove the trailing semicolon from the SQL string passed to JDBC.
- 2Step 2: Log the raw SQL bytes and check for null bytes or non-printable characters.
- 3Step 3: Strip non-ASCII characters from dynamically generated SQL before execution.
- 4Step 4: If using ADF, check the query field in the dataset or copy activity — ADF sometimes adds extra characters.
- 5Step 5: If running a script file, ensure it does not contain Windows-style CRLF line endings that Oracle misinterprets.
Example log output
ORA-00911: invalid character
SQL: SELECT * FROM orders WHERE status = 'OPEN';