ORA-00911: invalid character

Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
  • User AvatarANKUSH THAVALI
  • 06 Sep, 2023
  • 0 Comments
  • 1 Min Read

ORA-00911: invalid character

ORA-00911: invalid character

ORA-00911 : This is very common error & it Occurs usually for syntax mistakes. 

occurs usually when a programmer makes one of the following mistakes

1. when a special character is added in an SQL statement with column name.

SQL> select ename# from emp.hr;
select ename# from emp.hr
*
ERROR at line 1:
ORA-00904: "ENAME#": invalid identifier

2. when string is not enclosed by single quotes in where clause condition.
SQL> select * from emp where ename like A%;
select * from emp where ename like A%
                                    *
ERROR at line 1:
ORA-00911: invalid character

3. When some non-printable/special character added because of paste of sql statement from other editer.

SQL> select * from emp.HR where ename like `A%`;
select * from emp.HR where ename like `A%`
                                         *
ERROR at line 1:
ORA-00911: invalid character

4. when semicolon (;) is added to end the query in execute immediate of pl/sql.
SQL> begin
2 execute immediate 'update emp.hr set sal = sal * 1.1 where deptno=10;';
3 commit;
4 end;
5 /
begin
*
ERROR at line 1:
ORA-00911: invalid character
ORA-06512: at line 2

5. when a extra semicolon (;) is added to end the query.
SQL> select empno from emp;;
select empno from emp;
                     *
ERROR at line 1:
ORA-00911: invalid character

Hope it Helps!