Questions tagged [ora-00936]

ORA-00936: missing expression is an error message in Oracle.

ORA-00936 is an error in Oracle with the following error message.

ORA-00936: missing expression

Cause

A required part of a clause or expression in your SQL statement has been omitted and is not following the syntax . 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 where the columns are not mentioned.

56 questions
32
votes
4 answers

'NOT LIKE' in an SQL query

Why does this simple query return 'ORA-00936: missing expression' (the database is Oracle as you can tell): SELECT * FROM transactions WHERE id NOT LIKE '1%' AND NOT LIKE '2%' I feel silly, but what am I doing wrong?
Ariod
  • 5,757
  • 22
  • 73
  • 103
28
votes
7 answers

Why is selecting specified columns, and all, wrong in Oracle SQL?

Say I have a select statement that goes.. select * from animals That gives a a query result of all the columns in the table. Now, if the 42nd column of the table animals is is_parent, and I want to return that in my results, just after gender, so I…
glasnt
  • 2,865
  • 5
  • 35
  • 55
20
votes
4 answers

How to resolve ORA 00936 Missing Expression Error?

Select /*+USE_HASH( a b ) */ to_char(date, 'MM/DD/YYYY HH24:MI:SS') as LABEL, ltrim(rtrim(substr(oled, 9, 16))) as VALUE, from rrfh a, rrf b, where ltrim(rtrim(substr(oled, 1, 9))) = 'stata kish' and a.xyz = b.xyz The "from " (3rd line) part of…
user1466466
  • 1,206
  • 5
  • 15
  • 19
6
votes
3 answers

How to pass parameter values to a T-SQL query

I am using the following T-SQL query in SQL server 2005 (Management Studio IDE): DECLARE @id int; DECLARE @countVal int; DECLARE @sql nvarchar(max); SET @id = 1000; SET @sql = 'SELECT COUNT(*) FROM owner.myTable WHERE id = @id'; EXEC (@sql) AT…
David.Chu.ca
  • 37,408
  • 63
  • 148
  • 190
6
votes
4 answers

Oracle: Is there a way to get recent SQL syntax errors?

We are seeing a lot of "ORA-00936: missing expression" errors in our application log. Is there a way in Oracle to determine what statement(s) are failing? I tried querying v$sql, but these statements are not inserted into that view, since they don't…
CodingWithSpike
  • 42,906
  • 18
  • 101
  • 138
5
votes
1 answer

java.sql.SQLException: ORA-00936: missing expression

Below I am creating table. public static final String CREATE_SQL = "CREATE TABLE " +DATABASE_TABLE + "(ID number(10,0), " + " CGUID VARCHAR(255), " + " PGUID VARCHAR(255), " + " SGUID VARCHAR(255), " + …
AKIWEB
  • 19,008
  • 67
  • 180
  • 294
5
votes
2 answers

Syntax error: missing expression (ORA-00936)

I have 2 tables, Facilities and Services. CREATE TABLE Facilities ( facility_id NUMBER(2) NOT NULL, facility_name VARCHAR2(20) NOT NULL, CONSTRAINT pk_facil_id PRIMARY KEY (facility_id) ); CREATE TABLE Services ( service_id NUMBER(2) NOT…
adohertyd
  • 2,689
  • 19
  • 58
  • 78
4
votes
2 answers

ORA-00936: missing expression for a '='

A particular question that I've been asked to do for my D.A.D class is as follows: • Write a SQL statement that does the following: • Display the StuId, Movie No, Title, Runtime, Rating code, Rating Short Description, tmdb score for movies that meet…
Vas Theo
  • 39
  • 3
4
votes
1 answer

Oracle: Handling a field named COMMENT

I have a table with a field named COMMENT, which appears to be a reserved word. Using SQLDeveloper, if I try: select [COMMENT], another_field FROM table_created_by_idiot_developer I get SQL Error: ORA-00936: missing expression How can I…
chris
  • 36,094
  • 53
  • 157
  • 237
3
votes
1 answer

Getting error ORA-00936: missing expression

When I trying the below SQL I am getting the error ORA-00936: missing expression. Please help me on this, I want distinct on those to columns in Oracle SQL SELECT rr.RPT_QUE_I, DISTINCT (rr.ed_sbmt_m, rr.RPT_RUN_STAT_C), …
user1958780
  • 31
  • 1
  • 1
  • 5
2
votes
1 answer

problem in sql query

I have a query INSERT INTO NEW_TABLE (No_COUNT) VALUES (SELECT COUNT(*) FROM TABLE2) On executing in am getting ORA-00936: missing expression error. Any idea why above query showing error?
facebook
  • 1,894
  • 3
  • 21
  • 28
2
votes
2 answers

ORA 00936 error while using left outer join + syntax

I have two tables: T1 and T2 T1 has a DATE column: CT1 T2 has a DATE column: CT2 I want to left outer join T1 and T2 with join condition: trunc(CT1,'Mi')=trunc(CT2,'Mi')(+) When I try to run this SQL, I receive error ORA 00936:missing expression.…
ag112
  • 5,537
  • 2
  • 23
  • 42
2
votes
2 answers

Subquery within scalar subquery fails with error ORA-00936 Missing Expression

This is the query that does not work: SELECT distinct ord.DateOrdered , (SELECT docno FROM th_mm_c_orderline_history WHERE th_mm_c_orderline_history_id in (SELECT max(th_mm_c_orderline_history_id) FROM…
2
votes
2 answers

ORA - 00936 error but anable to find what is missing in line 2

I'm trying to execute this code but it says i'm missing something in row_number() expression which I'm not able to figure out at all. with summary as (select s.city, length(s.city) as C_length, row_number() over (partition by length(s.city), order…
gireesh4manu
  • 109
  • 2
  • 12
2
votes
2 answers

EDIT: ORA-00936: missing expression EDIT OF [ORA-00933: SQL command not properly ended]

[EDIT] I was told that the query has a Sub Query in it, So here is what i've come up with and what to work on now.[NEW CODE] SELECT P.prodid, P.prodname, SUM(O.qtysold) AS "TOTAL SALES" FROM ORDERLINE O INNER JOIN PRODUCT P ON O.prodid =…
Jacko
  • 21
  • 2
1
2 3 4