ORA-00911: invalid character

ORA-00911: invalid character
Cause: identifiers may not start with any ASCII character other than letters and numbers. $#_ are also allowed after the first character. Identifiers enclosed by doublequotes may contain any character other than a doublequote. Alternative quotes (q’#…#’) cannot use spaces, tabs, or carriage returns as delimiters. For all other contexts, consult the SQL Language Reference Manual.
Action: None

Reference: http://docs.oracle.com/cd/B28359_01/server.111/b28278/e900.htm#ORA-00910

ORA-00911 exception is very common and usually occurs for common syntax mistakes. ORA-00911 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 scott.emp;
select ename# from scott.emp
       *
ERROR at line 1:
ORA-00904: "ENAME#": invalid identifier

2. when some non-printable/special character added because of paste of sql statement from other editer (usually Acute` instead of quote’)

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

3. 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

4. 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

5. when semicolon (;) is added to end the query in execute immediate of pl/sql

SQL> begin
  2     execute immediate 'update scott.emp 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

6. when semicolon (;) is added to end the query executing from programming language like .net or java

 

From here

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s