Path: newssvr20.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!news.linkpendium.com!news2.telebyte.nl!fu-berlin.de!uni-berlin.de!193.132.150.105!not-for-mail
From: "Paul Tomlinson" <rubberducky703@hotmail.com>
Newsgroups: comp.databases.oracle.misc
Subject: Curious problem iterating through a ref cursor (recordset)
Date: Tue, 11 Nov 2003 11:38:39 -0000
Organization: -
Lines: 29
Message-ID: <boqho1$1hfdoo$1@ID-116287.news.uni-berlin.de>
Reply-To: "Paul Tomlinson" <rubberducky703@hotmail.com>
NNTP-Posting-Host: 193.132.150.105
X-Trace: news.uni-berlin.de 1068550721 51885848 193.132.150.105 (16 [116287])
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Xref: newssvr20.news.prodigy.com comp.databases.oracle.misc:133022

All,

I have the following autonomous block.  What I want to do is to iterate
through each record in the result-set and simply output the job_id.  I have
simplified the example greatly for your viewing:


DECLARE
    TYPE recordset IS REF CURSOR;
    lresult recordset;
BEGIN
    open lresult for select * from jobs;
    close lresult;
    for lrec in lresult
    loop
        dbms_output.put_line(lrec.job_id);
    end loop;
END;

I get the error:  PLS-000221: 'LRESULT' is not a procedure or is undefined
ORA-06550.

Any ideas how I can get around this?
PT


P.S.  Does anyone know of any good PL/SQL newsgroups/news servers?


