Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Primary keys don't work?
????
A Delphi TTable *does* show the records ordered automatically by primary
key, by default. This goes for Paradox and MS-SQL tables, with which we've
been working for years.
Are you telling me that would not be the case with an Oracle database as
backend?
Jan
Andrew Hardy <nobody_at_spam.from.news.AdvanticaTech.com> wrote in message
news:9oauai$6rh$1_at_sun-cc204.lut.ac.uk...
> A primary key does not imply the order in which rows are returned in SQL.
>
> To determine the order in which you want to return your data, use the
ORDER
> BY clause.
>
> Andy
>
> "Jan Doggen" <massoft_at_tref.nl> wrote in message
> news:9oaq2j$4a0$1_at_reader05.wxs.nl...
> > Hi everyone,
> >
> > in Delphi 4 we're creating and accessing tables through the BDE and
TCP/IP
> > connections to an Oracle 8 database.
> > These tables have single-field primary keys, either created with
> >
> > > CREATE TABLE
> > > ...
> > > CONSTRAINT PK_INDX PRIMARY KEY (fldname)
> > or
> > > CREATE TABLE
> > > followed by
> > > ALTER TABLE ADD PRIMARY KEY(fldname)
> >
> > Sometimes the records are *not* ordered by their primary key:
> > - if we use a Delphi TTable and jump to the last record it's not the
last
> ID
> > - if we use Delphi SQL Explorer to look at the data, the records are not
> > ordered by the primary key field
> >
> > The app is doing a lot of record appends, truncate tables etc.
> > The app also runs on MS-SQL without problems, the code logic seems fine.
> >
> > What could be going on here?
> > Is there such a thing as the index not being 'maintained' in Oracle?
> >
> > Thanks in advance for all suggestions
> > Jan
> >
> >
> >
>
>
Received on Thu Sep 20 2001 - 02:08:47 CDT