Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-00904 invalid identifier

480196Sep 7 2007 — edited Sep 10 2007

Hello,

I am not seeing what I am doing wrong here. I'm getting an ORA-00904 error:

failed to parse SQL query:
ORA-00904: "V_SDN"."SDN": invalid identifier

Here's my code:

DECLARE

v_stmt     VARCHAR2(2000);

   CURSOR cur_sdn IS
      SELECT DISTINCT sdn
            FROM filter_defs
            WHERE switch_id = :P1_SWITCH_ID 
            AND user_id = :P1_USER_ID;

v_sdn cur_sdn%ROWTYPE;
BEGIN   

   v_stmt := 'SELECT ani, DECODE(sdn,';

   FOR v_sdn IN cur_sdn LOOP
      v_stmt := v_stmt || 'v_sdn.sdn,''XXXXXX'',';
   END LOOP;

   v_stmt := v_stmt || 'sdn) FROM messages WHERE switch_id = :P1_SWITCH_ID;';

RETURN v_stmt;
END;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 8 2007
Added on Sep 7 2007
5 comments
2,001 views