Calling a CLOB Locator Fails With ORA-22275 [ID 161530.1]
| |||||
修改時間 22-JUL-2009 型別 PROBLEM 狀態 PUBLISHED |
In this Document
Applies to:
PL/SQLThis problem can occur on any platform.
Symptoms
Running PLSQL code containing call to EMPTY_CLOB() fails withORA-22275: invalid LOB locator specified
Changes
Sample user "scott" must be installed on the test machine running the code shown below.The user "scott" can be installed by connecting as SYS or SYSTEM user an run the following scripts to be found on the RDBMS Server depending on operating system
- Linux / Unix : $ORACLE_HOME/rdbms/admin/utlsampl.sql
- Windows : %ORACLE_HOME%\rdbms\admin\utlsampl.sql
Cause
A LOB that is passed to package DBMS_LOB cannot be a variable initialized by EMPTY_CLOB() as this does not create a valid lob locator.It must either be initialized by selecting the clob from the database or by using DBMS_LOB.CREATETEMPORARY
Solution
Example how to avaid the ORA-22275connect scott/tiger
set serveroutput on
create or replace procedure test_clob (p_clob_res out clob) is
cursor c_tabs is
select ename from emp;
v_clob clob;
amt integer := 0;
begin
dbms_lob.createtemporary(v_clob,true,dbms_lob.session);
for r_tabs in c_tabs
loop
dbms_lob.writeappend(v_clob,length(r_tabs.ename)+1,r_tabs.ename||' ');
amt := amt + length(r_tabs.ename);
end loop;
p_clob_res := v_clob;
end test_clob;
/
create or replace procedure call_clob is
p_clob clob;
my_buff varchar2 (2000);
amt binary_integer := 2000;
begin
test_clob(p_clob);
my_buff := dbms_lob.substr(p_clob,amt,1);
dbms_output.put_line(my_buff);
end call_clob;
/
begin
call_clob();
end;
/
set serveroutput on
create or replace procedure test_clob (p_clob_res out clob) is
cursor c_tabs is
select ename from emp;
v_clob clob;
amt integer := 0;
begin
dbms_lob.createtemporary(v_clob,true,dbms_lob.session);
for r_tabs in c_tabs
loop
dbms_lob.writeappend(v_clob,length(r_tabs.ename)+1,r_tabs.ename||' ');
amt := amt + length(r_tabs.ename);
end loop;
p_clob_res := v_clob;
end test_clob;
/
create or replace procedure call_clob is
p_clob clob;
my_buff varchar2 (2000);
amt binary_integer := 2000;
begin
test_clob(p_clob);
my_buff := dbms_lob.substr(p_clob,amt,1);
dbms_output.put_line(my_buff);
end call_clob;
/
begin
call_clob();
end;
/
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/11411056/viewspace-734475/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Service Locator 模式模式
- clob處理
- Fails To Open / Create The Wallet: ORA-28353 [ID 395252.1]AI
- DataPump Export (EXPDP) Fails With Error LPX-216 Invalid CharacterExportAIError
- Drop Table Fails With ORA-600 [15264] [ID 338953.1]AI
- Recover Database Fails with RMAN-06558 [ID 1185074.1]DatabaseAI
- XDMCP connection failsAI
- 報錯求助:Unsupported locator strategy: -ios predicate stringiOS
- 用SERVICE LOCATOR 模式實現命名訪問 (轉)模式
- Cluster Verification Check Fails With exectask: not found (Doc ID 1271177.1)AI
- OPEN RESETLOGS FAILS WITH ORA-01577 (Doc ID 953293.1)AI
- After failed upgrade, startup fails on ORA-00704 [ID 1345417.1]AI
- clob 欄位查詢
- Microsoft實現的IOC DI之 Unity 、Service Locator、MEFROSUnity
- 【MOS】EXPDP Fails ORA-39165: Schema SYS Was Not Found (文件 ID 553402.1)AI
- RMAN 11g Import catalog fails RMAN-6429 (Doc ID 457392.1)ImportAI
- RMAN backup fails with Ora-00245 And Rman-08132 [ID 1365484.1]AI
- 巧用xmltype解析clob資料XML
- CLOB與BLOB的轉換
- Oracle Blob 轉換為ClobOracle
- PLSQL中慎用CLOB型別SQL型別
- SQL SERVER 2008 新功能:physical row locator functionSQLServerFunction
- Fails to Start: PMON (ospid: nnnn): terminating the instance due to error 481AIError
- EM GC11.1.0.1 Agent Startup on AIX Fails with Error: nmectl_validate_1386861.1GCAIError
- OPatch Fails With "OUI-67028:Inventory load failed" (Doc ID 1185246.1)AIUI
- [20130301]clob欄位的empty_clob與NULL.txtNull
- Oracle Clob的一致讀Oracle
- JDBC處理包含CLOB欄位JDBC
- java jdbc存取oracle clob型別JavaJDBCOracle型別
- BLOB及CLOB欄位處理
- 關於Oracle的BLOB和CLOBOracle
- Restore Controlfile from SBT Tape Fails RMAN-6172 (Doc ID 1314134.1)RESTAI
- 11g Agent Upload Fails with "OMS version not checked Yet". (Doc ID 1265052.1)AI
- ASM disk group mount fails with ORA-15036: disk is truncated [ID 1077175.1]ASMAI
- Oracle Database Fails to Start with Error ORA-12547 [ID 1307075.1]OracleDatabaseAIError
- Fails to Join the Cluster as CRSD and EVMD are in INTERMEDIATE StateAI
- BULK COLLECT FAILS WITH ORA-04030AI
- 【MOS】Creating a PDB ... Fails With ORA-17630 (文件 ID 2090019.1)AI