Exception Occured: ORA-06502: PL/SQL: numeric or value error: invalid LOB locator specified: ORA-222 [message #462898] |
Mon, 28 June 2010 10:02  |
archana485
Messages: 22 Registered: June 2010
|
Junior Member |
|
|
Hi,
I have a stored procedure that reads records from the db and writes into a file and FTP's the file to a remote server.
The following is the proc that creates the file
the CMD_STRING is a CLOB variable
PROCEDURE Processfileid (file_id_in IN VARCHAR2,
noofrec IN PLS_INTEGER)
IS
CURSOR RECORD IS
SELECT cmd_string
FROM &schema..&batchfileentry
WHERE file_id = file_id_in;
limit_in PLS_INTEGER DEFAULT 10000;
TYPE record_tt
IS TABLE OF RECORD%ROWTYPE INDEX BY PLS_INTEGER;
l_record RECORD_TT;
fileid utl_file.file_type;
BEGIN
dbms_lob.Createtemporary(l_record, true);
fileid := utl_file.Fopen (mdsp.filecreationdirectory, file_id_in, 'W');
utl_file.Putf (fileid, mdsp.codeoffcs
||mdsp.codeoffgs, mdsp.padding);
OPEN eptrecord;
LOOP
FETCH RECORD BULK COLLECT INTO l_record LIMIT limit_in;
FOR indx IN 1 .. l_record.COUNT LOOP
utl_file.Put_line(fileid, L_record(indx).cmd_string);
END LOOP;
EXIT WHEN RECORD%notfound;
END LOOP;
CLOSE RECORD;
utl_file.Fclose (fileid);
EXCEPTION
WHEN OTHERS THEN
IF utl_file.Is_open(fileid) THEN
utl_file.Fclose (fileid);
END IF;
IF RECORD%isopen THEN
CLOSE RECORD;
END IF;
RAISE;
END processfileid;
I am getting the following exception when this is invoked:
Exception Occured: ORA-06502: PL/SQL: numeric or value error: invalid LOB locator specified: ORA-22275
ORA-06512: at "SYS.DBMS_LOB", line 517
I need to initialise the LOB locator but i am not able to figure out how to do it. Please help !
** Please format yourself in the future
[Updated on: Mon, 28 June 2010 10:16] by Moderator Report message to a moderator
|
|
|
|