ora-00936

'NOT LIKE' in an SQL query

烈酒焚心 提交于 2019-12-20 09:49:24
问题 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? 回答1: You have missed out the field name id in the second NOT LIKE . Try: SELECT * FROM transactions WHERE id NOT LIKE '1%' AND id NOT LIKE '2%' The AND in the where clause joins 2 full condition expressions such as id NOT LIKE '1%' and can't be used to list multiple values that

ORA-00936: missing expression oracle

ε祈祈猫儿з 提交于 2019-12-17 21:12:47
问题 I have this query SELECT DAL_ROWNOTABLE.DAL_ID FROM ( SELECT ticket.id AS "DAL_ID", ROWNUMBER ( Order By ticket.id ) AS "DAL_ROWNUMBER" FROM ticket_table ticket WHERE ( ticket.type = N'I' ) AND ( ticket.tenant IS NULL OR ticket.tenant IN ( SELECT * FROM ( SELECT tenant_group_member.tenant_id FROM tenant_group_member WHERE tenant_group_member.tenant_group = HEXTORAW('30B0716FEB5F4E4BB82A7B7AA3A1A42C') ORDER BY ticket.id ) ) ) ) DAL_ROWNOTABLE WHERE DAL_ROWNOTABLE.DAL_ROWNUMBER BETWEEN 1 AND 21

How to resolve ORA 00936 Missing Expression Error?

Deadly 提交于 2019-12-05 15:56:48
问题 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 the above query is giving me ORA-00936 Missing EXPRESSION error . Please Help me NOTE :: rrfh table contains no data. 回答1: Remove the comma? select /*+USE_HASH( a b ) */ to_char(date, 'MM/DD/YYYY HH24:MI:SS') as LABEL, ltrim(rtrim(substr(oled, 9, 16)))

How to resolve ORA 00936 Missing Expression Error?

做~自己de王妃 提交于 2019-12-04 00:59:07
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 the above query is giving me ORA-00936 Missing EXPRESSION error . Please Help me NOTE :: rrfh table contains no data. Remove the comma? 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 Have a

'NOT LIKE' in an SQL query

自古美人都是妖i 提交于 2019-12-02 21:18:30
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? You have missed out the field name id in the second NOT LIKE . Try: SELECT * FROM transactions WHERE id NOT LIKE '1%' AND id NOT LIKE '2%' The AND in the where clause joins 2 full condition expressions such as id NOT LIKE '1%' and can't be used to list multiple values that the id is 'not like'. You need to specify the column in both expressions. SELECT * FROM transactions WHERE id

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

孤街浪徒 提交于 2019-12-02 12:02:20
问题 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), " + " USERID VARCHAR(255), " + " ULOC VARCHAR(255), " + " SLOC VARCHAR(255), " + " PLOC VARCHAR(255), " + " ALOC VARCHAR(255), " + " SITEID VARCHAR(255), " + " ATTRIBUTEID VARCHAR(255), " + " ATTRIBUTEVALUE VARCHAR(255), " + " PRIMARY KEY ( ID ))"; This is the below UPSERT_SQL query when I am

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

只愿长相守 提交于 2019-12-02 06:29:59
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), " + " USERID VARCHAR(255), " + " ULOC VARCHAR(255), " + " SLOC VARCHAR(255), " + " PLOC VARCHAR(255), " + " ALOC VARCHAR(255), " + " SITEID VARCHAR(255), " + " ATTRIBUTEID VARCHAR(255), " + " ATTRIBUTEVALUE VARCHAR(255), " + " PRIMARY KEY ( ID ))"; This is the below UPSERT_SQL query when I am trying to update my database table I am always getting- java.sql.SQLException: ORA-00936: missing expression

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

≯℡__Kan透↙ 提交于 2019-11-30 15:51:32
问题 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 pass the syntax checks. Our C# application is using Linq to generate a query to an Oracle database. This makes it a bit difficult to get the sql query from the application. I was hoping I could just get it from Oracle easier. 回答1: You can create a

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

戏子无情 提交于 2019-11-30 15:21:45
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 pass the syntax checks. Our C# application is using Linq to generate a query to an Oracle database. This makes it a bit difficult to get the sql query from the application. I was hoping I could just get it from Oracle easier. You can create a trigger in Oracle that will log all errors (or pretty much all - NO_DATA_FOUND is not considered an error).

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

一曲冷凌霜 提交于 2019-11-29 01:12:29
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 can see it more easily. But I also want all the other columns. select is_parent, * from animals This returns ORA-00936: missing expression . The same statement will work fine in Sybase, and I know that you need to add a table alias to the animals table to get it to work ( select is_parent, a.* from animals ani ), but why must Oracle need a table