3

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 Answer 1

6

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

Sign up to request clarification or add additional context in comments.

2 Comments

thanx Naeel for the reply. i am trying to store pdf file on my database. And i want to fetch the pdf file from the database to my jsp page. plz help me. its urgent!!!
Look at this If file is stored on a server in the folder described with CREATE DIRECTORY then it is possible to use DBMS_LOB package to read the file and put it into a table. Regarding to JSP there are two ways, I think. 1) just extract to the folder accessable for the web-server, and give URL to the client. 2) load file and return it directly as http-response. See examlpe

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.