【发布时间】:2020-09-17 18:21:38
【问题描述】:
这两种语法允许从 oracle 中的字符串中获取第二个单词
SELECT REGEXP_SUBSTR('Hello this is an example', '\s+(\w+)\s') AS syntax1,
SUBSTR('Hello this is an example',
INSTR('Hello this is an example', ' ', 1, 1) + 1,
INSTR('Hello this is an example', ' ', 1, 2)
- INSTR('Hello this is an example', ' ', 1)
) AS syntax2
FROM dual;
结果:
syntax1 syntax2
------- -------
this this
我在 ODI(oracle 数据集成)中工作,这两种语法在 ODI 中不起作用: 对于 ODI,正则表达式无效,INSTR 函数只接受 2 个参数
您能建议我一个可以在 ODI 中使用的解决方案吗?
谢谢。
【问题讨论】:
标签: sql oracle substring oracle-data-integrator