Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2007
    Posts
    3

    Unanswered: out of reference error

    I'm getting a 'cursor reference out of scope' error on the following:


    CREATE OR REPLACE PROCEDURE ImportImages AS

    CaseExist BOOLEAN;
    v_sType VARCHAR2 (2) := NULL;
    v_sSource VARCHAR2 (1) := NULL;
    CURSOR c_Records IS
    SELECT * FROM STG_IMAGEIMPORT;
    Cursor c_Type is
    SELECT *
    FROM SourceExplanation
    WHERE trim(SourceExplanation.SESOURCE) = 'X';
    BEGIN

    FOR v_CurrentRecord IN c_Records LOOP

    IF NOT CaseExist THEN

    if c_Type%Found then
    v_sType := c_Type.SEType; -- ERROR HERE
    v_sSource := c_Type.SESource; -- ERROR HERE
    end if;

    IF v_sType is not Null THEN

    .....
    end if;
    end if;
    end loop;
    end;



    Basically I need to pull a second cursor down inside a loop / If block to see if something returns and if so do something interesting.


    Thanks in advance!!

    James

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    If I'm not wrong, you didn't open/fetch from cursor C_TYPE.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •