COLB变量中使用正则表达式替换

chenzhengcan 2010-04-26 10:25:41
COLB变量中使用正则表达式替换?
这个如何做?用这个函数报错:regexp_replace
...全文
105 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
codearts 2010-04-28
  • 打赏
  • 举报
回复
REGEXP_REPLACE(source_char, pattern
[, replace_string
[, position
[, occurrence
[, match_parameter ]
]
]
]
)

source_char is a character expression that serves as the search value. It is commonly a character column and can be of any of the datatypes CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB or NCLOB.


pattern is the regular expression. It is usually a text literal and can be of any of the datatypes CHAR, VARCHAR2, NCHAR, or NVARCHAR2. It can contain up to 512 bytes. If the datatype of pattern is different from the datatype of source_char, Oracle Database converts pattern to the datatype of source_char. For a listing of the operators you can specify in pattern, please refer to Appendix C, "Oracle Regular Expression Support".



replace_string can be of any of the datatypes CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB. If replace_string is a CLOB or NCLOB, then Oracle truncates replace_string to 32K. The replace_string can contain up to 500 backreferences to subexpressions in the form \n, where n is a number from 1 to 9. If n is the backslash character in replace_string, then you must precede it with the escape character (\\). For more information on backreference expressions, please refer to the notes to "Oracle Regular Expression Support", Table C-1.

iihero_ 2010-04-28
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 codearts 的回复:]

1) regexp_replace 10g以上才有

2)regexp_replace只支持字符串,CLOB转进去,也是隐式转为字符串的。假如CLOB过长,就会报错
[/Quote]
Nod. 不超过4K的CLOB好像能处理。
codearts 2010-04-28
  • 打赏
  • 举报
回复
1) regexp_replace 10g以上才有

2)regexp_replace只支持字符串,CLOB转进去,也是隐式转为字符串的。假如CLOB过长,就会报错

  • 打赏
  • 举报
回复
什么错
?
ngx20080110 2010-04-26
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 chenzhengcan 的回复:]
普通类型没问题呀,clob 类型老报错呀
[/Quote]
把你的例子和错误信息贴出来吧
chenzhengcan 2010-04-26
  • 打赏
  • 举报
回复
普通类型没问题呀,clob 类型老报错呀
ngx20080110 2010-04-26
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 java3344520 的回复:]
regexp_replace 你的数据库是9I的?和我一样不能用
只有哦10G版本以上才有这个函数
[/Quote]
在10g我试过可以用,9i没装没得试.
iqlife 2010-04-26
  • 打赏
  • 举报
回复
regexp_replace 你的数据库是9I的?和我一样不能用
只有哦10G版本以上才有这个函数

17,086

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧