今天调试程序报下面错误:

ORA-22828: input pattern or replacement parameters exceed 32K size limit
22828. 00000 - "input pattern or replacement parameters exceed 32K size limit"
*Cause: Value provided for the pattern or replacement string in the form of
VARCHAR2 or CLOB for LOB SQL functions exceeded the 32K size limit.
*Action: Use a shorter pattern or process a long pattern string in multiple
passes.

可用下面脚本重现:

declare
cb clob;
ret_cb CLOB;
begin
cb := rpad('x', 32767, 'x')||'x';
ret_cb := '<resp>#result#</resp>';
ret_cb := replace(ret_cb, '#result#', cb);
end;
/

解决方案例如以下:

编写函数:

create or replace function replace_with_clob
(i_source in clob
,i_search in varchar2
,i_replace in clob
) return clob is
l_pos pls_integer;
begin
l_pos := instr(i_source, i_search);
if l_pos > 0 then
return substr(i_source, 1, l_pos-1)
|| i_replace
|| substr(i_source, l_pos+length(i_search));
end if;
return i_source;
end replace_with_clob;

改写后:

declare
cb clob;
ret_cb CLOB;
begin
cb := rpad('x', 32767, 'x')||'x';
ret_cb := '<resp>#result#</resp>';
ret_cb := replace_with_clob(ret_cb, '#result#', cb);
dbms_output.put_line(substr(ret_cb, 1, 100));
end;
/

运行成功!

-----------------------------------

Dylan    Presents.

ORA-22828 输入样式或替换參数超过了32k限制大小的更多相关文章

  1. go test命令參数问题

    go test命令參数问题 在使用go test对go代码进行单元測试的时候,遇到关于命令參数的问题.google了一下,没有找到非常好的说明,其实就是一些细节而已. 问题是这种,在进行单元測试的时候 ...

  2. 【Python】Python获取命令行參数

    有时候须要用同一个Python程序在不同的时间来处理不同的文件,此时假设老是要到Python程序中去改动输入.输出文件名称.就太麻烦了. 而通过Python获取命令行參数就方便多了.以下是我写得一个小 ...

  3. 第8章2节《MonkeyRunner源代码剖析》MonkeyRunner启动执行过程-解析处理命令行參数

    MonkeyRunnerStarter是MonkeyRunner启动时的入口类,由于它里面包括了main方法.它的整个启动过程主要做了以下几件事情: 解析用户启动MonkeyRunner时从命令行传输 ...

  4. [Shell]输入參数

    获取shell脚本的输入參数,而且推断得到的參数. #!/bin/bash #title: testPT.sh #atuhor: orangleliu #date: 2014-08-08 #desc: ...

  5. 从头认识Spring-3.8 简单的AOP日志实现(注解版)-扩展添加检查订单功能,以便记录并检測输入的參数

    这一章节我们讨论一下扩展添加检查订单功能,以便记录并检測输入的參数. 1.domain 蛋糕类: package com.raylee.my_new_spring.my_new_spring.ch03 ...

  6. 从头认识Spring-3.4 简单的AOP日志实现-扩展添加检查订单功能,以便记录并检測输入的參数

    这一章节我们再上一个章节的基础上加上一个检查订单功能 1.domain 蛋糕类: package com.raylee.my_new_spring.my_new_spring.ch03.topic_1 ...

  7. C语言中的system函数參数具体解释

    http://blog.csdn.net/pipisorry/article/details/33024727 函数名: system 功   能: 发出一个DOS命令   用   法: int sy ...

  8. springmvc学习笔记(13)-springmvc注解开发之集合类型參数绑定

    springmvc学习笔记(13)-springmvc注解开发之集合类型參数绑定 标签: springmvc springmvc学习笔记13-springmvc注解开发之集合类型參数绑定 数组绑定 需 ...

  9. 【深夜福利】Caffe 添加自己定义 Layer 及其 ProtoBuffer 參数

    在飞驰的列车上,无法入眠.外面阴雨绵绵,思绪被拉扯到天边. 翻看之前聊天,想起还欠一个读者一篇博客. 于是花了点时间整理一下之前学习 Caffe 时添加自己定义 Layer 及自己定义 ProtoBu ...

随机推荐

  1. WINDOWS 线程 纤程 进程

    http://www.cnblogs.com/edisonchou/p/4848131.html#3277980

  2. hint.css使用说明

    GitHub:http://liu12fei08fei.github.io/html/1hint.html hint.css使用说明 用途 快速实现tooltips提示样式 相关资源 官方网站GitH ...

  3. Delphi 跨平台 Socket 通讯库

    Delphi 跨平台 Socket 通讯库 免费开源的Delphi 跨平台 Socket 通讯库. 源码URL:https://github.com/winddriver/Delphi-Cross-S ...

  4. Extjs gridPanel 动态指定表头

    var colMArray = new Array(); colMArray = [{header : "产品代码", dataIndex : "cpdm", ...

  5. window.open("url?param="+paramvalue) 服务端 乱码问题解决

    window.open("url?param="+paramvalue)传递参数出现乱码,在客房端显示是正常的,可是到服务端就是乱码. 1. 利用一个js在客户端转码的函数,esc ...

  6. 修改Eclipse/MyEclipse项目的默认编码

    应该是中文操作系统的原因,eclipse默认的新项目的编码是GBK,出于对编码支持的考虑,项目组中最好统一要求是UTF-8编码进行开发. 修改eclipse的配置,可以使得eclipse的新建项目的默 ...

  7. jquery、js获取table,遍历输出tr中各个td的内容。

    首先,依赖jquery.. $('#btntb').click(function(){ $('#tab tr').each(function(i){ // 遍历 tr $(this).children ...

  8. HTTP协议状态码详解(HTTP Status Code)(转)

    原文链接:HTTP协议状态码详解(HTTP Status Code) 使用ASP.NET/PHP/JSP 或者javascript都会用到http的不同状态,一些常见的状态码为: 200 – 服务器成 ...

  9. 【STL学习】堆相关算法详解与C++编程实现(Heap)

    转自:https://blog.csdn.net/xiajun07061225/article/details/8553808 堆简介   堆并不是STL的组件,但是经常充当着底层实现结构.比如优先级 ...

  10. Binary Tree Postorder Traversal leetcode java

    题目: Given a binary tree, return the postorder traversal of its nodes' values. For example: Given bin ...