[Fix]-ORA-00911 invalid character xsql error
ORA-00911 invalid character xsql error
Scenario:
SQL query is used in the xsql file as shown below:
My sample.xsql:
<?xml version="1.0" ?>
<page connection="labor" xmlns:xsql="urn:oracle-xsql">
<xsql:query>
SELECT id, name, dept, project_name FROM wikitechyEmp JOIN wikitechyProject ON wikitechyEmp.Id = wikitechyProject.id
</xsql:query>
</page>
Error:
ORA-00911: invalid character error occurs but the same query works well directly on the database.
Fix 1:
This error may occur when the query is typed and pasted from an editor that contains non-printable characters. Hence delete the query and re-type the same directly in the xsql file.
Fix 2:
Sometime there are chances that a special character appears in SQL WHERE clause and the value is not present within the single quotations. Hence the parse the query once to remove or handle special characters.
Fix 3:
The special character other than $, _, and # may be in use with column name. Ensure that such column names are enclosed in double quotations.