ORA-00936 missing expression

ORA-00936 missing expression

Cause: A required part of a clause or expression has been omitted. For example, a SELECT statement may have been entered without a list of columns or expressions or with an incomplete expression. This message is also issued in cases where a reserved word is misused, as in SELECT TABLE.

Action: Check the statement syntax and specify the missing component.

Reference: Oracle Documentation

ORA-00936 exception most commonly occurs when you try to execute SQL SELECT statement with one of the following syntax problems:

1. forget to list the columns in select statement
select from scott.emp
SQL> select from scott.emp;
select from scott.emp
       *
ERROR at line 1:
ORA-00936: missing expression


2. use distinct after some column name
SQL> select ename, distinct sal from scott.emp;
select ename, distinct sal from scott.emp
              *
ERROR at line 1:
ORA-00936: missing expression


3. add a extra comma in list of columns
SQL> select empno, ename, ,sal from scott.emp;
select empno, ename, ,sal from scott.emp
                     *
ERROR at line 1:
ORA-00936: missing expression


4. execute select statement with into clause in SQL
SQL> select max(sal) into msal from scott.emp;
select max(sal) into msal from scott.emp
                     *
ERROR at line 1:
ORA-00905: missing keyword


5. when we add a special character by mistake
SQL> select deptno, count(1) / from emp group by deptno;
select deptno, count(1) / from emp group by deptno
                          *
ERROR at line 1:
ORA-00936: missing expression

Related Posts:
- ORA-00911: invalid character
- ORA-01722: invalid number
- ORA-06550: line n, column n
- ORA-00904: invalid identifier
- ORA-06502: PL/SQL: numeric or value errorstring


No comments:

Post a Comment