DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: cursor for loop using function returns PLS-302

  1. #1
    Join Date
    May 2009
    Posts
    2

    cursor for loop using function returns PLS-302

    I am attempting to use a funtion in a cursor for loop but get the following error;

    for c in (select upper(program_name) from caudit_program_exclude)
    loop
    ProgramTbl(c.program_name) := c.program_name;
    end loop;

    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    40/5 PL/SQL: Statement ignored
    40/18 PLS-00302: component 'PROGRAM_NAME' must be declared

    Is this not allowed?

  2. #2
    Join Date
    Dec 2000
    Posts
    126
    send table caudit_program_exclude description

  3. #3
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,166
    Code:
    for c in (select upper(program_name) from caudit_program_exclude)
      loop
        ProgramTbl(c.program_name) := c.program_name;
      end loop;
    I see a number of issues.

    upper(program_name) needs to be aliased to program_name.

    Is ProgramTbl(c.program_name) a function? How can you assign a value to a function? If it is a procedure then just run the procedure "ProgramTbl(c.program_name);"

    What are you really trying to do?

  4. #4
    Join Date
    May 2009
    Posts
    2
    ProgramTbl is an array

Posting Permissions

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


Click Here to Expand Forum to Full Width