Board index » delphi » Oracle & TTable bug?

Oracle & TTable bug?

Hello everyone!

This is my first posting to this newsgroup. I have a question about a bug
(as it appears) with TTable. We have just installed Oracle 7.3.4 on Windows
NT and we have Delphi C/S 3.02 & BDE 4.51. I created a table Person with 2
fields:
IDPerson char 10 not null,
Name varchar 50.
The primary key is PrimaryKey( IDPerson ), the table contains 5 records.

Form contains just TTable, TDataSource, TDataBase, TDBGrid and TDBNavigator
components.

The problem is:
when I use a TTable and connect it to an Oracle table the following occurs:
if I add a record and enter data in IDPerson and data is all numerics, then
everything is OK, but if I enter the data which contains alphanumerics
(characters), first the record is moved to the beginning instead to the
position where it belongs, and then when I close and open the table again,
all the records in TDBGrid are duplicated. If I jump to the last record and
scroll back to the first, the data gets triplicated, and so on. If I reenter
IDPerson with all numerics, the situation is corrected.

I have tried various combinations of TTable and TDatabase settings, but
nothings seems to help. The only way that seemed to work is to change the
IndexName or IndexFields when the TTable is Active. I haven't tried this
with any other table type or other SQL server (like Interbase).

This problem doesn't occur with TQuery (either RequestLive = TRUE or FALSE).

Can anyone help me with this? I've tried searching some bug lists and
newsgroups but didn't find the answer.

Thanks in advance!
B.

 

Re:Oracle & TTable bug?


Does the IDPerson field contain embedded spaces, mixed-case or special
characters like "-".  This is a problem with the BDE that we see
frequently with Oracle, but not Interbase.  It can also exhibit as a
failure in the locate method.  Sometimes a refresh on the table will
help, sometimes not.  If you can, you're better off using TQuery.
Search the archives for threads on this subject; there's lots.

Quote
MS wrote:

> Hello everyone!

> This is my first posting to this newsgroup. I have a question about a bug
> (as it appears) with TTable. We have just installed Oracle 7.3.4 on Windows
> NT and we have Delphi C/S 3.02 & BDE 4.51. I created a table Person with 2
> fields:
> IDPerson char 10 not null,
> Name varchar 50.
> The primary key is PrimaryKey( IDPerson ), the table contains 5 records.

> Form contains just TTable, TDataSource, TDataBase, TDBGrid and TDBNavigator
> components.

> The problem is:
> when I use a TTable and connect it to an Oracle table the following occurs:
> if I add a record and enter data in IDPerson and data is all numerics, then
> everything is OK, but if I enter the data which contains alphanumerics
> (characters), first the record is moved to the beginning instead to the
> position where it belongs, and then when I close and open the table again,
> all the records in TDBGrid are duplicated. If I jump to the last record and
> scroll back to the first, the data gets triplicated, and so on. If I reenter
> IDPerson with all numerics, the situation is corrected.

> I have tried various combinations of TTable and TDatabase settings, but
> nothings seems to help. The only way that seemed to work is to change the
> IndexName or IndexFields when the TTable is Active. I haven't tried this
> with any other table type or other SQL server (like Interbase).

> This problem doesn't occur with TQuery (either RequestLive = TRUE or FALSE).

> Can anyone help me with this? I've tried searching some bug lists and
> newsgroups but didn't find the answer.

> Thanks in advance!
> B.

Re:Oracle & TTable bug?


Nick,

Would you mind explaining the down sides effects of using TQuery instead of
TTable?

Best regards

Henrik Staun Poulsen

Re:Oracle & TTable bug?


Henrik,
Disadvantages are all related to data-aware controls.  Some say just
don't use them.  Updatable DBGrids can be difficult; that's when we use
TTable, though we limit their use to small result sets in master/detail
types of forms.  I have seen posts that claim TQuery with cached updates
will work, though you must .close, .open to refresh, and there are some
rules about the order of ApplyUpdates with master/detail.  Since we
don't use these techniques, maybe someone else will jump in and explain
them.

Quote
Henrik Staun Poulsen wrote:

> Nick,

> Would you mind explaining the down sides effects of using TQuery instead of
> TTable?

> Best regards

> Henrik Staun Poulsen

Re:Oracle & TTable bug?


Nick,

Thank you very much for your help. Do you know of any books worth while reading
about Delphi on Oracle?

Best regards
Henrik

Re:Oracle & TTable bug?


Sorry, not really.  We use the Oracle, The Complete Reference and DBA
Handbook for 7.3 available from Oracle Press.  I can however recommend
TOAD, a shareware Oracle available at http:/www.toadsoft.com.  It's
written in Delphi and is a good learning tool.  Also uses DOA, Direct
Oracle Access, a BDE replacement for Oracle that, unfortunately, we
cannot use due to our need for database independence.

Quote
Henrik Staun Poulsen wrote:

> Nick,

> Thank you very much for your help. Do you know of any books worth while reading
> about Delphi on Oracle?

> Best regards
> Henrik

Other Threads