My Oracle Support Banner

Selectiing an Arithmetic Expression from Dual May Fail With: ORA-00936: missing expression (Doc ID 1547817.1)

Last updated on FEBRUARY 16, 2019

Applies to:

Oracle Data Provider for .NET - Version and later
Information in this document applies to any platform.


Attempting to execute the following simple query:

select 4 - .2 from dual

fails with:

ORA-00936: missing expression

Executing .NET code using ODP similar to the following demostrates the issue:

Dim conn As Oracle.DataAccess.Client.OracleConnection = New Oracle.DataAccess.Client.OracleConnection(My.Settings.oraconn)
Dim da As Oracle.DataAccess.Client.OracleDataAdapter
Dim ds As New DataSet
da = New Oracle.DataAccess.Client.OracleDataAdapter("select 4 - .2 from dual", conn)

A 100046 trace that is generated when the error is generated shows the SQL:

select 4-. 2 from dual

ODP.NET changes the SQL and strips out spacing causing the exception.

Executing the same bad SQL from SQL PLUS shows the same error:

SQL> select select 4-. 2 from dual;
select select 4-. 2 from dual
ERROR at line 1:
ORA-00936: missing expression


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.