Solved

Storing/Retrieving Oracle BLOB fields

Posted on 2004-08-18
4
763 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

Independent Software Vendors: 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

Suggested Solutions

Title # Comments Views Activity
Downloading email attachments 2 96
Convert GUI app into console app for Win32 Env 5 140
update joined tables 2 74
How to make Sign in, using Clientdataset? 1 43
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…

752 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