How to Insert Blob Datatype Values in Oracle 11g Database Through SQL*Plus

我是研究僧i 提交于 2019-12-10 20:14:34

问题


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.


回答1:


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);

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

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

SQLPLUS also shows BLOBs as hex-string

select * from b1;

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

Please refer Oracle documentation on Using LOBs



来源:https://stackoverflow.com/questions/23380823/how-to-insert-blob-datatype-values-in-oracle-11g-database-through-sqlplus

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!