oracle 是否有根据 CLOB 字段的字节数获取子字符串的方法?
select DBMS_LOB.SUBSTR(a.COMMENTS, 3998, 1)
FROM FOO;
Run Code Online (Sandbox Code Playgroud)
我收到错误:
“ORA-06502:PL/SQL:数字或值错误:字符串缓冲区太小”
. 问题出在特殊字符上。每个新的特殊字符需要 8 个字节,所以当我将字符串限制减少到 3992 时,它就可以工作了。
DBMS_LOB.SUBSTR(a.COMMENTS, 3992, 1) works.
Run Code Online (Sandbox Code Playgroud)
出于测试目的,我放置了许多特殊字符,但它再次抛出相同的错误。
oracle 是否有任何方法可以根据字节数而不是字符数查找子字符串?
实际上,我们正在从表中获取数据,需要在 UI 上显示,限制为 4000 个字符。所以,我们只想获取前 4000 个字符。由于,一个字符大小为 1 个字节,我们可以容纳 4000 个字节。因此,如果我们使用DBMS_LOB.CONVERTTOBLOB,我们可能无法正确显示获取的字符串。我们可以以某种方式将其转换回字符字符串吗?
我正在尝试为我正在处理的地图项目将一些区域设为绿色,将一些区域设为红色。我不知道如何让id="100101"一个透明的绿色和<area id="100102"一个透明的红色。任何帮助,将不胜感激!!:-)
<html>
<map name="floorplanfp">
<area id="100101" title="1" href="../carry.php?id=1001002" shape="rect" coords="52,3,239,187" style="outline:none;" target="_self" data-maphilight='{"alwaysOn":true,"stroke":false,"fillColor":"efb1a6","fillOpacity":"0.3"}'/>
<area id="100102" title="2" href="../carry.php?id=1002" shape="rect" coords="241,4,360,100" style="outline:none;" target="_self" />
<area id="100103" title="3" href="../carry.php?id=1003" shape="rect" coords="240,101,359,248" style="outline:none;" target="_self" />
<area id="100104" title="4" href="../carry.php?id=1004" shape="rect" coords="52,225,163,391" style="outline:none;" target="_self" />
<area id="100105" title="5" href="../carry.php?id=1005" shape="rect" coords="243,258,354,314" style="outline:none;" target="_self" />
<area id="100106" title="6" href="../carry.php?id=1006" shape="rect" coords="48,389,206,547" style="outline:none;" target="_self" />
<area id="100107" title="7" href="../carry.php?id=1007" shape="rect" coords="208,389,356,547" style="outline:none;" target="_self" />
<area id="100109" title="9" href="../carry.php?id=1009" shape="rect" coords="358,394,447,520" style="outline:none;" target="_self" …Run Code Online (Sandbox Code Playgroud)