Export blob into database using Oratable?

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jdredd
Posts: 42
Joined: Wed 25 Mar 2009 21:14

Export blob into database using Oratable?

Post by jdredd » Wed 22 Apr 2009 22:07

Just something generic

procedure exportdata;
var x:longint;
begin
t1.open;
t1.first;
t1.Edit;
for x:=0 to filelist.count-1 do
begin
memo1.lines.add('exporting '+filelist[x]);
t1.insert;
t1.fieldByName('imageid').Text:=extractfilename(filelist[x]);

// somewhere here to populate field IMAGEBLOB with a
// blob that is in imagefile

end;
end;


Just a tstringlist of files to send. It creates the IMAGEID field..
but not sure how to get the BLOB? field which is called IMAGEBLOB to populate with data?

This is delphi 7 using ODAC 6.70.0.45

I can populate this table by hand in SQLDeveloper.. and I use a component called ImageEN to grab the images out of it, using the oratable and oradatasource just fine.

I just need to populate this table with 125k + files.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 23 Apr 2009 08:46

You can use the following code to load BLOB to the field:

Code: Select all

t1.GetLob('IMAGEBLOB').LoadFromFile(extractfilename(filelist[x])); 

Post Reply