如何通过SQL * Plus在Oracle 11g数据库中插入Blob数据类型值 [英] How to Insert Blob Datatype Values in Oracle 11g Database Through SQL*Plus

查看:298
本文介绍了如何通过SQL * Plus在Oracle 11g数据库中插入Blob数据类型值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个具有Blob数据类型的表,但是我不知道如何使用SQL * Plus将值插入表中或查看表内容.请帮助我.

I have created a table with Blob datatype but I do not know how to insert values into the table or view the table content using SQL*Plus. Please help me.

推荐答案

这取决于要放入BLOB中的数据类型.让我们考虑一下表格:

It depends on what kind of data you want put into a BLOB. Let's consider the table:

create table b1(id number , b blob);

如果您的数据表示为十六进制字符串,则应使用TO_BLOB函数

If your data represented as hex-string you should use TO_BLOB function

insert into b1 values(1,to_blob('FF3311121212EE3a'));

SQLPLUS还将BLOB显示为十六进制字符串

SQLPLUS also shows BLOBs as hex-string

select * from b1;

----- -----------------------------------
   ID                                   B
----- -----------------------------------
    1 FF3311121212EE3A

请参考使用LOB 上的Oracle文档.

Please refer Oracle documentation on Using LOBs

这篇关于如何通过SQL * Plus在Oracle 11g数据库中插入Blob数据类型值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆