获取错误ORA-22275:指定了无效的LOB定位符

时间:2014-05-14 08:17:36

标签: oracle

我是LOB数据类型的新手,我收到错误将执行此程序脚本如下....

CREATE TABLE SA_ZIP_TEST (
   SEQ          NUMBER,
   STRING_BLOB  BLOB,
   STRING_CLOB  CLOB,
   DT           DATE
);

CREATE OR REPLACE PROCEDURE ZIP(src IN clob, dst IN OUT NOCOPY BLOB )
IS
BEGIN
   IF src is not null THEN
      DBMS_LOB.createtemporary(dst, true, DBMS_LOB.CALL);
      XML_ZIP_PKG_2.ZIP_CLOB(src, dst);
      DBMS_LOB.FREETEMPORARY(dst);
   END IF;
END ZIP;

执行以下脚本会收到错误消息ORA-22275

DECLARE
   V_Query_Str VARCHAR2 (4000);
   V_RESULT CLOB; 
   V_RESULT2 bLOB;
BEGIN
   DBMS_LOB.CREATETEMPORARY(V_Result, TRUE, dbms_lob.session);
   FOR I IN 1..100
   LOOP
      V_Query_Str:=
         'INSERT INTO SA_ZIP_TEST
            (seq
            ,DT
            ,STRING_BLOB
            )
         VALUES
            (:Cmd_Seq
            ,:Cmd_DT 
            ,:Result)
      ';
      xml_zip_pkg_2.ZIP(V_Result,V_RESULT2);
      EXECUTE IMMEDIATE V_Query_Str USING I, SYSDATE,V_RESULT2 ;
   END LOOP;
END;

1 个答案:

答案 0 :(得分:3)

由于V_RESULT2内的xml_zip_pkg_2.ZIP(V_Result,V_RESULT2);

},{p> DBMS_LOB.FREETEMPORARY(dst);在调用ZIP后成为无效的定位器