Solved

Storing/Retrieving Oracle BLOB fields

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Find and Replace Stream with 0s 8 72
Delphi: Connect to running MS Outlook 4 162
SUM 2 INTEGER ARRAYS INTO 1 10 111
Way to create an iPhone app for my customers 8 43
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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

749 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