Click to See Complete Forum and Search --> : an error about cursor in Oracle Report


musicbox
09-08-2004, 08:23 AM
I add a formula in report, and the PL/SQL codes are like these:

function CF_contents return Char
is
v_info VARCHAR2 (65);
v_desc VARCHAR2 (2000);
CURSOR cur_info
IS
SELECT CONTENTS FROM a
where key=:event_key;
BEGIN
v_desc := NULL;
OPEN cur_info;
LOOP FETCH cur_info INTO v_info;
EXIT WHEN cur_info%NOTFOUND;
v_desc := v_desc || v_info || CHR (10);
END LOOP;

CLOSE cur_info;

v_desc := SUBSTR (v_desc, 1, LENGTH (v_desc) - 1);
return (v_desc);

exception
when no_data_found then
....;
when others then
....;
end;

but in report,when peview data, error messages are:
"REP-1401: 'cf_contents' : Fatal PL/SQL error occured "

and i try to run it on report server, error messages are:
"Terminated with error:
REP-56048: Engine null crashed, job Id: 54200 "

I don't know why? please help me, Thanks a lot!