1

有一个 BLOB 列包含如下数据:

{{Property1 {property1_string}} {Property2 {property2_string}} {Property3 {property3_string}} {Property4 {property4_string}} {Property5 {property5_string}}}

我选择上面的列显示BLOB数据,如下:

utl_raw.cast_to_varchar2(dbms_lob.substr(blobColumn))

我只需要显示 BLOB 列的第 4 个属性的数据,因此如下:
{Property4 {property4_string}}

因此,我需要帮助来为此目的创建必要的选择。

谢谢你。

4

2 回答 2

0

这将起作用:

select substr(cast(blobfieldname as 
varchar2(2000)),instr(cast(blobfieldname as 
varchar2(2000)),'{',1,8)),instr(cast(blobfieldname as 
varchar2(2000)),'}',1,8))- 
instr(cast(blobfieldname as varchar2(2000)),'{',1,8))) from tablename;
于 2018-12-18T11:14:22.173 回答
0

您可以使用REGEXP_SUBSTR.

select REGEXP_SUBSTR(s,'[^{} ]+', 1, 2 * :n) FROM t;

其中 n 是您要从数据中提取的第 n 个属性字符串。

n = 1 gives property1_string
n = 2 gives property2_string 
..
and so on

注意s应该是输出utl_raw.cast_to_varchar2

演示

于 2018-12-18T14:07:50.677 回答