title: Column exists but still get this error ORA-00904: invalid identifier
body: <p>Anyone can help me with this issue</p>
  
  <pre><code>declare 
  
      lv2_sql VARCHAR2(32767);
  
      cursor c_scv is
      select financial_code, object_id, daytime from stream_category_version;
  
  begin
  
  for r_scv in c_scv LOOP
  
    IF r_scv.financial_code = 'PURCHASE' THEN
  
     lv2_sql := 'UPDATE stream_category_version ' || CHR(10) || 
     'set REVN_PURCHASES_IND = ''Y'', last_updated_by = nvl(last_updated_by, created_by) '  || CHR(10) || 
     'WHERE object_id = r_scv.object_id AND daytime = r_scv.daytime';
     ecdp_dynsql.execute_statement(lv2_sql);   
  
    ELSIF r_scv.financial_code = 'SALE' THEN
  
     lv2_sql := 'UPDATE stream_category_version ' || CHR(10) || 
     'set REVN_SALES_IND = ''Y'', last_updated_by = nvl(last_updated_by, created_by) '  || CHR(10) || 
     'WHERE object_id = r_scv.object_id AND daytime = r_scv.daytime';
     ecdp_dynsql.execute_statement(lv2_sql);  
  
  
    END IF;
  
  END LOOP; 
  
  end;
  </code></pre>
  
  <p>I have code as shown above, but i got error saying 'ORA-00904: R_SCV.DAYTIME: invalid identifier'. I have checked the table definition for 'stream_category_version' and found the column DAYTIME as shown below</p>
  
  <pre><code>SQL&gt; desc stream_category_version
  Name               Type           Nullable Default Comments 
  ------------------ -------------- -------- ------- -------- 
  OBJECT_ID          VARCHAR2(32)                             
  DAYTIME            DATE                                     
  END_DATE           DATE           Y                         
  NAME               VARCHAR2(240)  Y                          
  FINANCIAL_CODE     VARCHAR2(32)   Y                         
  SORT_ORDER         NUMBER         Y                         
  COMMENTS           VARCHAR2(2000) Y
  </code></pre>
  
  <p>Then i am confused with the error. Anyone can help me ? </p>
  
  <p>Thanks in advance.                        </p>