how to replace multiple strings together in Oracle(如何在 Oracle 中一起替换多个字符串)
问题描述
我有一个来自表的字符串,例如can no pay{1},as your payment{2}due on {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 中一起替换多个字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 Oracle 中一起替换多个字符串


- SQL 临时表问题 2022-01-01
- 更改自动增量起始编号? 2021-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01