【发布时间】:2012-07-03 10:44:18
【问题描述】:
使用 Oracle 11g,我有以下 LDAP 字符串,这只是我在此处尝试演示的内容的一个子集。
基本上我有一个很长的字符串导致我出现“字符串文字太长”的问题,基本上在这个字符串中,我希望能够去掉我不想要的位,甚至更好,去掉只有我需要的部分。
这只是字符串内容/长度的简短版本:
成员 = CN=aTIGERAdmin-Admin, CN=D0902498, CN=ea90045052, CN=aTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=aTIGERAdmin-Admin, CN=ea90045052, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-管理员,CN=DAaTIGERCall-Admin,CN=DAaTIGERCall-Admin,CN=DAaTIGERCall-Admin,CN=DAaTIGERCall-Admin,CN=DAaTIGERCall-Admin,CN=DAaTIGERCall-Admin,CN=aTIGERCall-Admin,CN=aTIGERAdmin-Admin, CN=D0902498, CN=ea90045052, CN=aTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=aTIGERAdmin-Admin, CN=ea90045052, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-管理员,CN=DAaTIGERCall-Admin,CN=DAaTIGERCall-Admin,CN=DAaTIGERC全管理员,CN=DAaTIGERCall-Admin,CN=aTIGERCall-Admin,
假设上面的长度大于 4000 个字符。
我的问题是,使用 Oracle SQL 和 PL/SQL 以及上面的“成员”字符串,我需要以某种方式只过滤掉看起来像 'CN=aTIGER%' 的位,并完全忽略看起来像 'CN 的条目=DAaTIGER%' 我相信,我们解决了我的字符串文字问题,但我无法先过滤掉它,因为我的原始字符串已经超过 4000 个字符长。
使用 pl/sql,我正在寻找一种方法,它只返回“成员”中看起来像 'CN=aTIGER%' 的条目,同时完全忽略看起来像 'CN=DAaTIGER%' 的条目, 确保结果末尾还有一个逗号。
我是否需要将其分配给 CLOB,然后处理我需要的条目?
【问题讨论】:
-
CN=D0902498或CN=ea90045052等条目怎么样? -
导致错误的文字多长时间?您是否尝试将字符串拆分为可变数组?
标签: sql regex oracle plsql oracle11g