ora-00904

Oracle query on String [duplicate]

我的未来我决定 提交于 2020-12-16 05:29:41
问题 This question already has answers here : ORA 00904 Error:Invalid Identifier (2 answers) Closed last month . I want to perform my query on a string in this format, xxxx/xxxx where x is a number. when I perform it using the Oracle interface or my C# application I get this error: ORA-00904: "xxxx/xxxx": invalid identifier I performed this query: SELECT * FROM "My Table" WHERE Field="xxxx/xxxx" 回答1: You should use single quotes aroung SQL character literals like xxxx/xxxx: SELECT * FROM "My Table

ORA 00904 Error:Invalid Identifier

帅比萌擦擦* 提交于 2020-01-10 03:53:14
问题 I have installed Oracle 10g in my virtual XP and created a table using create table reg1 ( fname varchar2(30), lname varchar2(30), addr varchar2(30), mail varchar2(30), occu varchar2(30), uname varchar2(30), passwd varchar2(30) ); and the table created successfully.But when I am trying to fetch the values by simple query like select fname, lname from reg1 where uname="bbb"; I am getting error like ORA-00904: "bbb": invalid identifier I cannot understand what I have done wrong here. 回答1: Use

DBMS LOB.SUBSTR Throwing ORA-00904: Invalid Identifier Error

假如想象 提交于 2020-01-04 11:05:05
问题 One of our cutomer is running the scripts in oracle sql developer to upgrade his database table structure, procudere & triggers etc. But while running the script, he is getting ORA-00904: Invalid Identifier Error for DBMS_LOB.SUBSTR() and DBMS_LOB.GETLENGTH() in one procedure. Can somebody tell why is happening so? There are using Oracle Sql developer Version 3.1.07 Build MAIN-07.42 with Oracle 11g. 回答1: I imagine 3 possible reasons: the user lacks execute privilege on sys.dbms_lob (although

DBMS LOB.SUBSTR Throwing ORA-00904: Invalid Identifier Error

我的梦境 提交于 2020-01-04 11:03:01
问题 One of our cutomer is running the scripts in oracle sql developer to upgrade his database table structure, procudere & triggers etc. But while running the script, he is getting ORA-00904: Invalid Identifier Error for DBMS_LOB.SUBSTR() and DBMS_LOB.GETLENGTH() in one procedure. Can somebody tell why is happening so? There are using Oracle Sql developer Version 3.1.07 Build MAIN-07.42 with Oracle 11g. 回答1: I imagine 3 possible reasons: the user lacks execute privilege on sys.dbms_lob (although

Sql query on rownum

[亡魂溺海] 提交于 2019-12-25 03:15:17
问题 SELECT instmax FROM (SELECT instmax ,rownum r FROM ( SELECT instmax FROM pswlinstmax ORDER BY instmax DESC NULLS LAST ) WHERE r = 2 ); After execution it's giving this error: ORA-00904: "R": invalid identifier 00904. 00000 - "%s: invalid identifier" *Cause: *Action: Error at Line: 39 Column: 8 why it's giving this error?? 回答1: Because aliases are not supported in the WHERE clause of the same query. So instead write your query like: SELECT instmax FROM (SELECT instmax ,rownum r FROM ( SELECT

Dynamic SQL syntax using EXECUTE IMMEDIATE

泄露秘密 提交于 2019-12-25 00:43:15
问题 Dynamic SQL update statement as below: EXECUTE IMMEDIATE 'UPDATE '||l_prefix||'CRS_CUSTOMERS SET CUSTOMER_SOURCE_REF_ID = '||i.CUSTOMER_REF_ID||' WHERE CUSTOMER_ID = '||i.CUSTOMER_ID; l_prefix is the parameter hold the prefix of table name, the value assigned is T_ i.CUSTOMER_REF_ID and i.CUSTOMER_ID are the fields fetched from cursor. The dynamic statement encounter error ORA-00904: invalid identifier when data fetched. When rewrite it in static way, the query is working fine: UPDATE T_CRS