如何在 edb 中使用相同的 REGEXP_REPLACE(Oracle sql)

How to use the same equivalent of REGEXP_REPLACE(Oracle sql) in edb

我正在从 oracle sql 迁移到 edb 并想转换正则表达式替换,但我无法将所有约束都带到 edb 等效项中。你能帮忙吗

SET account_no = RTRIM (LTRIM (REGEXP_REPLACE (account_no, '[A-Y]', '', 1, 0, 'i'), ' '), ' ')

如何在 edb 中引入位置 (1)、出现 (0) 和 match_parameter('i')。如果我使用相同的方法,则会出现以下错误

错误:函数regexp_replace(字符变化,未知,未知,整数,整数,未知)不存在 第 2 行:SET customer = RTRIM (LTRIM (REGEXP_REPLACE (customer, '... ^ 提示:没有函数匹配给定的名称和参数类型。您可能需要添加显式类型转换。 SQL 状态:42883 字符:52

PostgreSQL 对 regexp_replace() 的实现与 Oracle 的不同。函数签名 as mentioned in the documentationregexp_replace(source, pattern, replacement [, flags ])

调用 regexp_replace(account_no,'[A-Y]','','gi') 等同于您希望调用 regexp_replace(account_no,'[A-Y]','',1,0,'i')