This discussion is archived
3 Replies Latest reply: Oct 8, 2012 2:57 AM by 927867 RSS

invalid identifikator

927867 Newbie
Currently Being Moderated
Hi,

juz wondering what happened to my pl sql script. Not sure why it gave me an invalid identifikator error.. still new on pl sql.. see my script below
DECLARE
 
 CURSOR unlinkmat is
    select m.name
      , mf.nf_folderid
      , m.material_id
      , m.material_type_id
      --, material_util.get_system_path(m.material_id, m.material_type_id, 1) || m.material_id "system path"
       
      from material m, materialfolder mf, userinfo ui, unit_groups ug
      where m.owner_user_id = ui.ip_userid
      and ui.nf_unitid = ug.nf_unitid
      and m.material_id = mf.nfx_link
      and m.material_type_id = mf.nf_materialtypeid
      --and m.MATERIAL_TYPE_ID <> 8
      and nf_groupid = 221;
      
  BEGIN
  
  FOR materials_link in unlinkmat loop
  
   DELETE FROM materialfolder
   WHERE nfx_link = m.material_id
   AND nf_materialtypeid = m.material_type_id;
   
   DELETE FROM create_materialgroup
   WHERE nfx_materialid = m.material_id
   AND NF_MATERIALTYPEID = m.material_type_id;
   
   DELETE FROM shoppingcartlinks
   WHERE nfxmateriallinkid = m.material_id
   AND NF_MATERIALTYPEID = m.material_type_id;
  
  END LOOP;
  
 END;


Error report:
ORA-06550: linje 24, kolonne 28:
PL/SQL: ORA-00904: "M"."MATERIAL_TYPE_ID": ugyldig identifikator
ORA-06550: linje 22, kolonne 4:
PL/SQL: SQL Statement ignored
ORA-06550: linje 28, kolonne 28:
PL/SQL: ORA-00904: "M"."MATERIAL_TYPE_ID": ugyldig identifikator
ORA-06550: linje 26, kolonne 4:
PL/SQL: SQL Statement ignored
ORA-06550: linje 32, kolonne 28:
PL/SQL: ORA-00904: "M"."MATERIAL_TYPE_ID": ugyldig identifikator
ORA-06550: linje 30, kolonne 4:
PL/SQL: SQL Statement ignored
06550. 00000 -  "line %s, column %s:\n%s"
*Cause:    Usually a PL/SQL compilation error.
*Action:
Thank you and have a great day guys..

Regards,
J
  • 1. Re: invalid identifikator
    jeneesh Guru
    Currently Being Moderated
    DECLARE
     
     CURSOR unlinkmat is
        select m.name
          , mf.nf_folderid
          , m.material_id
          , m.material_type_id
          --, material_util.get_system_path(m.material_id, m.material_type_id, 1) || m.material_id "system path"
           
          from material m, materialfolder mf, userinfo ui, unit_groups ug
          where m.owner_user_id = ui.ip_userid
          and ui.nf_unitid = ug.nf_unitid
          and m.material_id = mf.nfx_link
          and m.material_type_id = mf.nf_materialtypeid
          --and m.MATERIAL_TYPE_ID  8
          and nf_groupid = 221;
          
      BEGIN
      
      FOR materials_link in unlinkmat loop
      --"Replaced m with materials_link for accessing the cursor values"
       DELETE FROM materialfolder
       WHERE nfx_link = materials_link.material_id
       AND nf_materialtypeid = materials_link.material_type_id;
       
       DELETE FROM create_materialgroup
       WHERE nfx_materialid = materials_link.material_id
       AND NF_MATERIALTYPEID = materials_link.material_type_id;
       
       DELETE FROM shoppingcartlinks
       WHERE nfxmateriallinkid = materials_link.material_id
       AND NF_MATERIALTYPEID = materials_link.material_type_id;
      
      END LOOP;
      
     END;
  • 2. Re: invalid identifikator
    bencol Pro
    Currently Being Moderated
    Change "m." to "materails_link.", so you are refering to rows in your cursor
  • 3. Re: invalid identifikator
    927867 Newbie
    Currently Being Moderated
    thank you guys.. :)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points