Home » Developer & Programmer » Forms » Error ORA-06502 in BLOB retrieval (Oracle Forms 6i + Oracle DB 11g)
Error ORA-06502 in BLOB retrieval [message #569556] Mon, 29 October 2012 08:53 Go to next message
lagranzotto
Messages: 2
Registered: October 2012
Location: Brasil
Junior Member
I'm trying to develop a procedure which will read a BLOB field of a table and write an RTF document which will be used as template to another procedure but when the procedure fires up the select statemente, i got stuck with a ORA-06502 error.

This error, after reading the documentation, is caused by incompatibilities between fields (numeric or value error string)

But i've seen this example everywhere in the internet and i'm running out of ideas of what is causing it.

The source code of my procedure follows:

PROCEDURE p_transfer_db_client(pcPath IN VARCHAR2,
pnSequence IN NUMBER) IS

v_src_blob BLOB;
v_file UTL_FILE.FILE_TYPE;
v_offset INTEGER := 1;
v_amount BINARY_INTEGER := 32766;
v_binary_buffer RAW(32767);

BEGIN

SELECT model into v_src_blob from models where id = pnSequence;

v_file := UTL_FILE.FOPEN(pcPath, 'model.rtf', 'wb', v_amount);

LOOP
BEGIN
DBMS_LOB.READ(v_src_blob, v_amount, v_offset, v_binary_buffer);
UTL_FILE.PUT_RAW(v_file, v_binary_buffer);
v_offset := v_offset + v_amount;
EXCEPTION
WHEN NO_DATA_FOUND THEN
EXIT;
END;
END LOOP;

UTL_FILE.FFLUSH(v_file);
UTL_FILE.FCLOSE(v_file);

END p_transfer_db_client;
Re: Error ORA-06502 in BLOB retrieval [message #569570 is a reply to message #569556] Mon, 29 October 2012 19:04 Go to previous message
cookiemonster
Messages: 11203
Registered: September 2008
Location: Rainy Manchester
Senior Member
Which line raises the error?
Previous Topic: Play sound after 1 minute
Next Topic: FRM-40405:No changes to apply
Goto Forum:
  


Current Time: Thu Nov 27 13:52:34 CST 2014

Total time taken to generate the page: 0.12397 seconds