Board index » delphi » Blob in Oracle DataBase via Delphi 2 ?

Blob in Oracle DataBase via Delphi 2 ?

On Mon, 02 Jun 1997 21:22:55 +0200, Frederic Juge <tar...@wanadoo.fr>
wrote:

Quote
>I want to store (and read) .BMP files (pictures), and .WAV files
>(sounds) in a database Oracle 7.3 ? Has anybody an idea ? It's easy with
>a local database like Paradox but I cannot do it with Oracle... If
>anybody has a sample code, I should be the happiest man on this
>newsgroup...

Hi,

I tried similar with 2 TTable-comps (one connected to Paradox and one
to Oracle) and a TBatchMove from Paradox to Oracle.

I tried it not with binary files, but with long textfiles. It works,
but it was very slow and hard to programm.

Than I found a VCL from a german programmer, who does exactly that via
the Oracle OCI-API. It saves lang texts and any binary files to Oracle
LONG-columns. It's very quick and easy to implement. But it's (rather
cheap) payware (about 400 german marks, about 250 $).

I only work with this VCL now. (I did not programm it, and do not get
any money for this).

If you are interested, ask at:

C.O.M. Menzel Neuhaus GmbH
Mr. Mike Bach
Schuetzenstr. 4-6
D-35578 Wetzlar
Fax. +49-64 41-92 95 99
Email: 100022,3...@compuserve.com

cu

Uli Kamp

 

Re:Blob in Oracle DataBase via Delphi 2 ?


Ulrich Kamp, Haus der Geschichte wrote:

Quote

> On Mon, 02 Jun 1997 21:22:55 +0200, Frederic Juge <tar...@wanadoo.fr>
> wrote:

> >I want to store (and read) .BMP files (pictures), and .WAV files
> >(sounds) in a database Oracle 7.3 ? Has anybody an idea ? It's easy with
> >a local database like Paradox but I cannot do it with Oracle... If
> >anybody has a sample code, I should be the happiest man on this
> >newsgroup...

> Hi,

> I tried similar with 2 TTable-comps (one connected to Paradox and one
> to Oracle) and a TBatchMove from Paradox to Oracle.

> I tried it not with binary files, but with long textfiles. It works,
> but it was very slow and hard to programm.

> Than I found a VCL from a german programmer, who does exactly that via
> the Oracle OCI-API. It saves lang texts and any binary files to Oracle
> LONG-columns. It's very quick and easy to implement. But it's (rather
> cheap) payware (about 400 german marks, about 250 $).

> I only work with this VCL now. (I did not programm it, and do not get
> any money for this).

> If you are interested, ask at:

> C.O.M. Menzel Neuhaus GmbH
> Mr. Mike Bach
> Schuetzenstr. 4-6
> D-35578 Wetzlar
> Fax. +49-64 41-92 95 99
> Email: 100022,3...@compuserve.com

> cu

> Uli Kamp

Hi Ulrich,

I've been using a live query in D2/3 to insert and update Oracle 7.2/7.3
Long Raw columns. I've been inserting images (jpeg, gif, fif, ...),
video's (avi, mov) and sounds (wav).

Such a live query might look like this :

SELECT BLOBS."ID" ,
 BLOBS."THEBLOB"
FROM "BLOBS" BLOBS
WHERE ( BLOBS."ID" = :id )

In your code do something like

 With theBlobQ do
  begin
    if Active then Close;
    Requestlive := True;
    ParamByName('id').AsInteger := anId; {might even not be existing}
    Open;
    If (BOF and EOF) then Append else Edit;
    FieldByName('ID').AsInteger := anID;
    theBlobQTHEBLOB.LoadFromFile('c:\image1.jpg');
    Post;
    Close;
  end;

This works fast enough for me. So what do you mean by "It works, but it
was very slow and hard to programm."? A colleague of mine coded a
C-programme with the OCI and inserting of a similar sized blob took
about the same time. In fact it looked perhaps about 5 % faster (which I
don't think is "very fast") but it is hard to measure reliably in a C/S
environment over an network. Could you give some times : how long does
it take on which equipment to store x KBytes?

Erwin Meekers

Re:Blob in Oracle DataBase via Delphi 2 ?


Quote
Frederic Juge wrote:
> Hi,

> I want to store (and read) .BMP files (pictures), and .WAV files
> (sounds) in a database Oracle 7.3 ? Has anybody an idea ? It's easy
> with
> a local database like Paradox but I cannot do it with Oracle... If
> anybody has a sample code, I should be the happiest man on this
> newsgroup...

Here it is :

 if OpenDialog1.Execute then begin
    try
        Query.Insert;
        QueryData.LoadFromFile(OpenDialog1.FileName);
        Query.Post;
    except
      on EDatabaseError do Query3.Cancel;
    end;
end;

Simple and full functional.

-------------------
David Vodnansky
ICL Czech republic
vodnan...@icl.cz
-------------------

Other Threads