🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.multi-tier
2 messages
2 total messages Started by Cash Albatros Tue, 23 Sep 2003 13:28
Storing afile as a Blob Data in Oracle Database and using blob data from database
#24
Author: Cash Albatros
Date: Tue, 23 Sep 2003 13:28
8 lines
1136 bytes
Hii,,
I wantto store media files in database as a blob data.

is there any sample code about writing and reading data in database

Thanks All.

Cash
Re: Storing afile as a Blob Data in Oracle Database and using blob data from database
#26
Author: Sydney Delieu
Date: Wed, 08 Oct 2003 21:57
66 lines
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.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads