Solved

Storing/Retrieving Oracle BLOB fields

Posted on 2004-08-18
4
764 Views
Last Modified: 2010-05-18
Hi,

I need to know which is the best way (most efficient) to save and retrieve files from an Oracle BLOB field.

Should I use a normal table component ie.

Database.StartTransaction;
Table.Insert;
Table KEYFLD.AsInteger := new_val;
Table TESTFLD.LoadFromFile('D:\data\test.bmp');
Table.Post;
Database.Commit;

or a TQuery component, or is there another better method.

Code examples will be appreciated.

Regards

0
Comment
Question by:barnarp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 25

Accepted Solution

by:
Tomas Helgi Johannsson earned 125 total points
ID: 11839035
         Hi

Use this method when posting to Oracle

with tTable do
begin
Insert;
TBlobField(FieldByName('PICTURE')).LoadFromFile(OpenPictureDialog1.FileName);
Post;
end;

Take also look at EDBImage and QREDBImage v.1.4  found on http://www.torry.net/pages.php?id=533.
If you want to post JPEGs to Oracle just remember to include jpeg in the uses clause.

Regards,
  Tomas Helgi
0
 
LVL 25

Expert Comment

by:Tomas Helgi Johannsson
ID: 11839085
Similar with retrieving

with tTable do
begin
.....
TBlobField(FieldByName('PICTURE')).SaveToFile(filename);
.....
end;

Regards,
  Tomas Helgi
0
 

Author Comment

by:barnarp
ID: 11839594
Thanks
0
 

Author Comment

by:barnarp
ID: 11867222
Hi,

I seem to be experiencing a problem with the ttable.

I have the following code as you suggested:

begin
   Open;
   Insert;
   TBlobField(FieldByName('CPLANT_BLOB')).LoadFromFile(DocCopyComment);
  Post;
end;

The moment I run Open, I get the following error:

General SQl Error ORA-000936: Missing Expression

Any idea what is going wrong?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses
Course of the Month7 days, 5 hours left to enroll

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question