Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BLOB HELP ???

Status
Not open for further replies.

rjoshi2

Programmer
Sep 10, 2002
110
US
Could some please post an example of creating a table with a column that is a BLOB? Also post a sample of how insert a BLOB into that table?

Thank You,
rjoshi2
 
More info:

I am trying to store powerbuilder reports (.psr file) in the database (as blob). That can be retrieved by a powerbuilder application.

Thank You,
rjoshi2
 
rjoshi2,

The following works for me:

create table myTable (
bb blob
);

insert into myTable (bb) values ('ff00123213ff00ffaa');

It seems that Oracle expects the blob value to be encoded as hex string, because when I tried:

insert into myTable (bb) values ('Q');

I got: ORA-01465: invalid hex number

Regards,
Dan
 
You can do it by opening the file in your application, reading it and converting the stream to an hexadecimal string.
Then you can insert it to the database.

When you read it from the database, you’ll need the convert it back from hexadecimal to binary.

Good Luck,
Dan
 
Dan,

If possible could you post an example? How long would it take the application to retrieve the “file” (blob) from the database?

Thank You,
rjoshi2
 
The code that you need for these conversions is powerbuilder specific code, which I don't have.
About the performance question - it really depends on the size of the file, the DB setup, the DB connection between your application and the DB, etc.

Sorry that I can't be more specific,
Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top