如何在Oracle中一起替换多个字符串 [英] how to replace multiple strings together in Oracle

查看:1895
本文介绍了如何在Oracle中一起替换多个字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个字符串,该字符串来自无法付款{1},因为您的付款{2}应于{3}支付"之类的表.我想将{1}替换为某些值,将{2}替换为某个值,并将{3}替换为某个值.

I have a string coming from a table like "can no pay{1},as your payment{2}due on {3}". I want to replace {1} with some value , {2} with some value and {3} with some value .

是否可以在一个替换功能中全部替换3个?还是有什么办法可以直接编写查询并获取替换值?我想替换Oracle存储过程中的这些字符串,原始字符串来自我的表之一,而我只是在该表上进行选择

Is it Possible to replace all 3 in one replace function ? or is there any way I can directly write query and get replaced value ? I want to replace these strings in Oracle stored procedure the original string is coming from one of my table I am just doing select on that table

然后我要将该字符串中的{1},{2},{3}值替换为另一个表中的其他值

and then I want to replace {1},{2},{3} values from that string to the other value that I have from another table

推荐答案

虽然不是一个调用,但是可以嵌套replace()调用:

Although it is not one call, you can nest the replace() calls:

SET mycol = replace( replace(mycol, '{1}', 'myoneval'), '{2}', mytwoval)

这篇关于如何在Oracle中一起替换多个字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆