1 Reply Latest reply on Feb 9, 2011 3:08 PM by Matperry-Oracle

    Error PL/SQL: ORA-22905: cannot access rows from a non-nested table item

    792262
      Hi,

      I am trying to fetch data from sparql query to cursor through procedure.

      Getting an exception: PL/SQL: ORA-22905: cannot access rows from a non-nested table item

      Please find the below sample procedure.

      CREATE OR REPLACE PROCEDURE Conceptual_Domain_pro
      AS
      CURSOR hist_cur
      IS
      SELECT CSD, CSDN, CSDSN, CSDA, CSSD
      FROM TABLE
      (sem_match
      ('(?CSD rdf:type ds:Conceptual_Source_Domain)
      (?CSD ds:hasConceptualSourceDomainName ?CSDN)
      (?CSD ds:hasConceptualSourceDomainShortname ?CSDSN)
      (?CSD ds:hasConceptualSourceDomainArchitect ?CSDA)
      (?CSD ds:hasConceptualSourceSubdomain ?CSSD)
      ',
      sem_models ('SRC_CURR'),
      NULL,
      sem_aliases(sem_alias('ds','http://www.cd-se.com/sbip/dwh/mdm/data_sources#')),
      NULL));
      L_CSD_ID Varchar2(250);
      L_CSD_NAME VARCHAR2(50);
      L_CSD_SHORT_NAME VARCHAR2(25);
      L_CSD_ARCHITECT VARCHAR2(25);
      L_CSSD_ID VARCHAR2(250);
      BEGIN
      OPEN hist_cur;
      LOOP
      FETCH hist_cur
      INTO L_CSD_ID ,
      L_CSD_NAME,
      L_CSD_SHORT_NAME,
      L_CSD_ARCHITECT,
      L_CSSD_ID;
      EXIT WHEN hist_cur%NOTFOUND;
      INSERT INTO Conceptual_Domain(CSD_ID,CSD_NAME,CSD_SHORT_NAME,CSD_ARCHITECT,CSSD_ID)
      VALUES(L_CSD_ID,L_CSD_NAME,L_CSD_SHORT_NAME,L_CSD_ARCHITECT,L_CSSD_ID);
      END LOOP;
      COMMIT;
      IF hist_cur%ISOPEN
      THEN
      CLOSE hist_cur;
      END IF;
      END Conceptual_Domain_pro;

      I am not sure how to solve this problem.

      Please help me to solve this problem.

      Regards,
      Kavitha.