Board index » delphi » store file(paradox database) in oracle clong field

store file(paradox database) in oracle clong field

I posted the following a few days ago.  The most obvious item I forgot to post.
The files that we use are actually thousands of paradox databases.  
The users just open a file (unknowing to them that it is a database).
Can I store the contents of a paradox database in Oracle??????

Thanks Again
Karen

Quote
> I recently heard that you can store the context of a text file in an Oracle Field.
> Can anyone tell me how to get started to do this.
> I want to put the text files in Oracle from a delphi application.

> How would I link this file, view the file and retrieve the file.

> Any hints or suggestions would be appreciated.

> Thanks in advance
> Karen

The easiest might be to define it as a CLONG in Oracle. Delphi should
create a TMemoField to access it which you can access as for any other
field.

Marc

 

Re:store file(paradox database) in oracle clong field


On 28 Dec 2001 06:17:43 -0800, Tony wrote:

You'll need to read up on Streams. I did a similar thing with XML
docs. You need to create you r table in Oracle or whatever with a
CLong (Blob or Memo Field Equivalent) and presumably an identifier
such as the file name or whatever.

To get the paradox file(s) in simply Create a TMemoryStream Object anf
use it's LoadFromFile Method. Then open the storage table Insert a new
record and Then Use TBlobField's LoadFromStream Method to Read the
TMemoryStream object you created from the file content. Post the
record and you are done.

P.S. Don't get caugth out by not using Seek.
MyStream.LoadFromFile('MyFile');
MyStream.Seek(0,soFromBeginning);
MyStream.SaveToStream(MyBlobField);

Load,Save, Read and Write all work from the current position and after
a load or save that's the end of the stream.

HTH

Quote
>I posted the following a few days ago.  The most obvious item I forgot to post.
>The files that we use are actually thousands of paradox databases.  
>The users just open a file (unknowing to them that it is a database).
>Can I store the contents of a paradox database in Oracle??????

>Thanks Again
>Karen

>> I recently heard that you can store the context of a text file in an Oracle Field.
>> Can anyone tell me how to get started to do this.
>> I want to put the text files in Oracle from a delphi application.

>> How would I link this file, view the file and retrieve the file.

>> Any hints or suggestions would be appreciated.

>> Thanks in advance
>> Karen

>The easiest might be to define it as a CLONG in Oracle. Delphi should
>create a TMemoField to access it which you can access as for any other
>field.

>Marc

Other Threads