ORA-29287: invalif maximum linesize
O.k. I wanted to load the BLOB column into a file.
I did this.
1. Create or replace DIRECTORY FILES as '/u01/app/oracle/lobs/files';
2. Create or replace procedure read_blob as
l_file UTL_FILE.FILE_TYPE;
l_buffer RAW(32767);
l_amount BINARY_INTEGER := 32767;
l_pos INTEGER := 1;
l_blob BLOB;
l_blob_len INTEGER;
BEGIN
Select col1 into l_blob from table1 where id = 1;
l_blob_len := DBMS_LOB.getLength(l_blob);
l_file := UTL_FILE.fopen('FILES', 'myTiff.tiff', 'w', 326767);
while l_pos < l_blob_len LOOP
DBMS_LOB.read(l_blob, l_amount, l_pos, l_buffer);
UTL_FILE.put_raw(l_file, l_buffer, TRUE);
l_pos := l_pos + l_amount;
END loop;
UTL_FILE.fclose(l_file);
EXCEPTION
WHEN OTHERS THEN
if UTL_FILE.is_open(l_file) then
UTL_FILE.fclose(l_file);
end if;
RAISE;
END READ_BLOB;
/
When I tryto execute I am getting the above error invalid maximum linesize. I have used only 32767 which is in the range [ 1 - 32767]
What am i doing wrong?