如何查询巨大的blob数据



我想查询表中的 hugeblob 属性。我在下面尝试过,但它在选择时没有提供任何数据。 从 mytable 中选择 DBMS_LOB.substr(mydata, 1000,1(;

还有其他方法可以做到这一点吗?

DBMS_LOB.substr(( 是正确的函数。确保列中有数据。

用法示例:

-- create table
CREATE TABLE myTable (
id INTEGER PRIMARY KEY,
blob_column BLOB
);
-- insert couple of rows
insert into myTable values(1,utl_raw.cast_to_raw('a long data item here'));
insert into myTable values(2,null);
-- select rows
select id, blob_column from myTable;
ID  BLOB_COLUMN
1   (BLOB)
2   null
-- select rows
select id, DBMS_LOB.substr(blob_column, 1000,1) from myTable;
ID  DBMS_LOB.SUBSTR(BLOB_COLUMN,1000,1)
1   61206C6F6E672064617461206974656D2068657265
2   null
-- select rows
select id, UTL_RAW.CAST_TO_VARCHAR2(DBMS_LOB.substr(blob_column,1000,1)) from myTable;
ID  UTL_RAW.CAST_TO_VARCHAR2(DBMS_LOB.SUBSTR(BLOB_COLUMN,1000,1))
1   a long data item here
2   null

最新更新