Board index » delphi » Oracle LOB fields with TTable and TQuery components

Oracle LOB fields with TTable and TQuery components

Hi!

I want to make an existing Delphi 4.0 application (BDE 5.01) to work with
Oracle8i. This application uses TTable and TQuery components for creating
and accessing data. For example it creates a table like this:

  with NewTable do
  begin
    DatabaseName := 'OneDatabase';
    TableName := 'OneTable';
    TableType := ttDefault;

    FieldDefs.Clear;
    FieldDefs.Add('Field1', ftInteger, 0, True);
    FieldDefs.Add('Field2', ftGraphic, 0, False);
    FieldDefs.Add('Field3', ftMemo, 0, False);
    if Exists then DeleteTable;
    CreateTable;
  end;

The problem is, that these FieldTypes are mapped to Oracle's LONG and LONG
RAW data types as any other like ftBlob, and Oracle supports only one such
field per table. I know that BLOB, CLOB fields don't have these
restrictions. But how can i make BDE to create such fields? Is there any
solution except CREATE TABLE scripts?

If not, and i create my tables with CREATE TABLE scripts, will i be able to
attach TTable and TQuery components to these tables?

Thanks,
Attila
--
For replies, remove the "eks" from the host name

 

Re:Oracle LOB fields with TTable and TQuery components


Quote
Attila Szucs wrote:

> If not, and i create my tables with CREATE TABLE scripts, will i be able to
> attach TTable and TQuery components to these tables?

You really should get used to writing Oracle scripts, and if you database is of
any size, you should get a modeling tool like Erwin to create the tables for
you.  Don't use TTable to access Oracle tables.  TQuery works no matter how the
tables are created.

John

Re:Oracle LOB fields with TTable and TQuery components


Thanks for you hint, i have the same oppinion.

The fact is, that the application was started to be written for PARADOX
databases, then made to work for SQL-Server also and now it has to be made
to work for Oracle too. Riding of TTables is a good idea, but it is a big
change in an existing application. I wanted to avoid this change at first.

Thanks for your answer,
Attila

Re:Oracle LOB fields with TTable and TQuery components


Quote
Attila Szucs wrote:

> Hi!

> I want to make an existing Delphi 4.0 application (BDE 5.01) to work with
> Oracle8i. This application uses TTable and TQuery components for creating
> and accessing data. For example it creates a table like this:

>   with NewTable do
>   begin
>     DatabaseName := 'OneDatabase';
>     TableName := 'OneTable';
>     TableType := ttDefault;

>     FieldDefs.Clear;
>     FieldDefs.Add('Field1', ftInteger, 0, True);
>     FieldDefs.Add('Field2', ftGraphic, 0, False);
>     FieldDefs.Add('Field3', ftMemo, 0, False);
>     if Exists then DeleteTable;
>     CreateTable;
>   end;

> The problem is, that these FieldTypes are mapped to Oracle's LONG and LONG
> RAW data types as any other like ftBlob, and Oracle supports only one such
> field per table. I know that BLOB, CLOB fields don't have these
> restrictions. But how can i make BDE to create such fields? Is there any
> solution except CREATE TABLE scripts?

If You can migrate to Delphi5 - do so. Delphi5 have ftOraBlob and
ftOraClob
data types.

Quote
> If not, and i create my tables with CREATE TABLE scripts, will i be able to
> attach TTable and TQuery components to these tables?

Yes, ofcourse.

--
------------------------------------------------------------------------
Dmitry L. Arefiev, senior programmer, Nica-Com ltd.,  Russia
Author of NCOCI8 - Freeware Delphi to Oracle8i direct access
EMail: cut_this_prefix.di...@ncom.ru           ICQ: 50741007
WWW:   http://www.ncom.ru/diman/index.html

Other Threads