Article View: borland.public.cppbuilder.database.multi-tier
Article #26Re: Storing afile as a Blob Data in Oracle Database and using blob data from database
From: Sydney Delieu
Date: Wed, 08 Oct 2003 21:57
Date: Wed, 08 Oct 2003 21:57
66 lines
2955 bytes
2955 bytes
Hi Cash Albatros,
Not sure about how Oracle handles BLOB's, but with MS-SQL I use:
To Store BLOB data:
...
TBlobField *ptrBlobField;
ptrBlobField =
(TBlobField*)cdsMyClientDataset->FieldByName("Some_Blob_Field");
cdsMyClientDataset->Edit();
ptrBlobField->LoadFromFile("SomeBlobFile.mov");
cdsMyClientDataset->Post();
...
To Use BLOB Data:
...
TBlobField *ptrBlobField;
ptrBlobField =
(TBlobField*)cdsMyClientDataset->FieldByName("Some_Blob_Field");
ptrBlobField->SaveToFile("SomeFilename.mov");
...
If you are using persistent fields, there is no need to use a pointer to a
TBlobField, as you can use the TBlobField by going into the Fields Editor
and obtaining the TBlobField name (which is always the Dataset name plus the
FieldName - ie. cdsMyClientDatasetSome_Blob_Field). You can also use the
SaveToStream and LoadFromStream methods.
Hope that this helps.
Syd.
p.s. You may be asking this in the wrong group.
Hi Cash Albatros,
Not sure about how Oracle handles BLOB's, but with MS-SQL I use:
To Store BLOB data:
...
TBlobField *ptrBlobField;
ptrBlobField =
(TBlobField*)cdsMyClientDataset->FieldByName("Some_Blob_Field");
cdsMyClientDataset->Edit();
ptrBlobField->LoadFromFile("SomeBlobFile.mov");
cdsMyClientDataset->Post();
...
To Use BLOB Data:
...
TBlobField *ptrBlobField;
ptrBlobField =
(TBlobField*)cdsMyClientDataset->FieldByName("Some_Blob_Field");
ptrBlobField->SaveToFile("SomeFilename.mov");
...
If you are using persistent fields, there is no need to use a pointer to a
TBlobField, as you can use the TBlobField by going into the Fields Editor
and obtaining the TBlobField name (which is always the Dataset name plus the
FieldName - ie. cdsMyClientDatasetSome_Blob_Field). You can also use the
SaveToStream and LoadFromStream methods.
Hope that this helps.
Syd.
p.s. You may be asking this in the wrong group.
Technical Details
Message-ID:
<3f84885d$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-06!sn-xit-05!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<3f704bb2@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fcd2b,904ef06357d3cd40 X-Google-Attributes: gidfcd2b,public X-Google-ArrivalTime: 2003-10-08 15:04:36 PST From: "Sydney Delieu" <sydbee@supanet.com> Newsgroups: borland.public.cppbuilder.database.multi-tier References: <3f704bb2@newsgroups.borland.com> Subject: Re: Storing afile as a Blob Data in Oracle Database and using blob data from database Date: Wed, 8 Oct 2003 22:57:46 +0100 Lines: 68 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 213.105.221.20 Message-ID: <3f84885d$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1065650269 213.105.221.20 (8 Oct 2003 14:57:49 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-06!sn-xit-05!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail