dbms_lob.write Failed with ORA-06502: PL/SQL: numeric or value error: invalid LOB locator specified: ORA-22275

advertisements

_____________________________________________________________________________________________________________________

The Eucharistic Miracles of the World

Error Description:
PLSQL Block with dbms_lob.write command is getting failed with following error. Command: dbms_lob.write (tempblob,length(tempname), 1,utl_raw.cast_to_raw (substr(tempname,1,length(tempname))));

Error:
declare
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: invalid LOB locator specified: ORA-22275
ORA-06512: at "SYS.DBMS_LOB", line 1124
ORA-06512: at line 12
Solution Description:
The reason for this error is because you have used a blob column in the PLSQL block which is not initialized. Blob variable needs to be initialized before using the dbms_lob.write. EMPTY_BLOB and EMPTY_CLOB functions need to be used to initialize a LOB variable. These functions return an empty LOB locator. You can use an insert or update command to initialize a LOB column.
Syntax:
update BL_TEST set TR_PIC=empty_blob();

_____________________________________________________________________________________________________________________

Website Stats

0 comments:

Post a Comment

Labels

Oracle (629) Script (86) General (77) Unix (47) Blog (23) Technology (19) gadget (6) games (6) Business (3) OCI (3) SQL* Loader (3) Datapump (2)
 

acehints.com Copyright 2011-23 All Rights Reserved | Site Map | Contact | Disclaimer