🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.multi-tier
5 messages
5 total messages Started by mpowell Fri, 30 Mar 2001 17:00
TClientDataSet RecNo
#603
Author: mpowell
Date: Fri, 30 Mar 2001 17:00
17 lines
1387 bytes
I have a record set that I would like to reorder. Is the RecNo property the
property that will correctly do so? IOW, If I make any changes to RecNo will
the record numbers for the remaining records change accordingly.

For example, say I have the following record set.

NAME; ID; RECNO
JOHN; 101; 1
PAUL; 201; 2
RINGO; 301; 3

Say I change RINGO to RECNO=1. Does this then change JOHN to RECNO=2 and
PAUL to RECNO=3? Alternately, what happens if I change PAUL to RECNO=3? What
precisely is the effect of changing RECNO in this manner?

Thanks in advance.
Re: TClientDataSet RecNo
#606
Author: mpowell
Date: Wed, 04 Apr 2001 20:10
36 lines
1788 bytes
Hello,

I'd really appreciate an answer to this. Is it possible to reorganize
(perhaps even swap) a record within a data set? The RecNo property isn't
quite what I had in mind, as it seems only to operate on the cursor. I would
like to move the record, not the cursor, within a data set.

Thanks.


"mpowell" <mike.powell@transcore.com> wrote in message
news:3ac4bbb2$1_1@dnews...
>
> I have a record set that I would like to reorder. Is the RecNo property
the
> property that will correctly do so? IOW, If I make any changes to RecNo
will
> the record numbers for the remaining records change accordingly.
>
> For example, say I have the following record set.
>
> NAME; ID; RECNO
> JOHN; 101; 1
> PAUL; 201; 2
> RINGO; 301; 3
>
> Say I change RINGO to RECNO=1. Does this then change JOHN to RECNO=2 and
> PAUL to RECNO=3? Alternately, what happens if I change PAUL to RECNO=3?
What
> precisely is the effect of changing RECNO in this manner?
>
> Thanks in advance.
>
>
>
Re: TClientDataSet RecNo
#607
Author: mpowell
Date: Wed, 04 Apr 2001 20:33
47 lines
2188 bytes
Another possibility is that I can perform whatever updates on the client
data set while it is "in place". Is it possible to sort a record set while
it is in place, or prior to applying any changes?


"mpowell" <mike.powell@transcore.com> wrote in message
news:3acb80f0_2@dnews...
>
> Hello,
>
> I'd really appreciate an answer to this. Is it possible to reorganize
> (perhaps even swap) a record within a data set? The RecNo property isn't
> quite what I had in mind, as it seems only to operate on the cursor. I
would
> like to move the record, not the cursor, within a data set.
>
> Thanks.
>
>
> "mpowell" <mike.powell@transcore.com> wrote in message
> news:3ac4bbb2$1_1@dnews...
> >
> > I have a record set that I would like to reorder. Is the RecNo property
> the
> > property that will correctly do so? IOW, If I make any changes to RecNo
> will
> > the record numbers for the remaining records change accordingly.
> >
> > For example, say I have the following record set.
> >
> > NAME; ID; RECNO
> > JOHN; 101; 1
> > PAUL; 201; 2
> > RINGO; 301; 3
> >
> > Say I change RINGO to RECNO=1. Does this then change JOHN to RECNO=2 and
> > PAUL to RECNO=3? Alternately, what happens if I change PAUL to RECNO=3?
> What
> > precisely is the effect of changing RECNO in this manner?
> >
> > Thanks in advance.
> >
> >
> >
>
>
Re: TClientDataSet RecNo
#608
Author: Mark Cashman
Date: Wed, 04 Apr 2001 22:57
23 lines
1828 bytes
Hi!

Recno means nothing to most DBMS which, for a variety of reasons may or
may not store records in any sort of "real" order (hash tables, for
instance have no real order).

Indexes give a view of the same records in the order the index decrees,
and each index has a different "order". In addition, in a real
client-server database, a single insertion could force recounting and
renumbering of a potentially prohibitive number of records.

To create a sequenced table you will need to have a sequence number
field and you will need to manage resequencing. It is a moderately
complex problem, but it can be done.

------
Mark Cashman (TeamB - C++ Builder), creator of The Temporal Doorway at
http://www.temporaldoorway.com
- Original digital art, writing, music and more -
C++ Builder / JBuilder Tips and The C++ Builder Programmer's Webring
(Join us!)
http://www.temporaldoorway.com/programming/index.htm
------
Re: TClientDataSet RecNo
#610
Author: mpowell
Date: Thu, 05 Apr 2001 14:21
36 lines
2218 bytes
Your suggestion is basically the approach I have taken. I was just wondering
if there was an "elegant" solution based on the data set itself. Though, now
there appears as though there isn't unless I were to subclass TClientDataSet
or something to perform such rearranging behavior.

Cheers!


"Mark Cashman" <mcashman@temporaldoorway.com> wrote in message
news:3ACBA6CC.A514FC7F@temporaldoorway.com...
> Hi!
>
> Recno means nothing to most DBMS which, for a variety of reasons may or
> may not store records in any sort of "real" order (hash tables, for
> instance have no real order).
>
> Indexes give a view of the same records in the order the index decrees,
> and each index has a different "order". In addition, in a real
> client-server database, a single insertion could force recounting and
> renumbering of a potentially prohibitive number of records.
>
> To create a sequenced table you will need to have a sequence number
> field and you will need to manage resequencing. It is a moderately
> complex problem, but it can be done.
>
> ------
> Mark Cashman (TeamB - C++ Builder), creator of The Temporal Doorway at
> http://www.temporaldoorway.com
> - Original digital art, writing, music and more -
> C++ Builder / JBuilder Tips and The C++ Builder Programmer's Webring
> (Join us!)
> http://www.temporaldoorway.com/programming/index.htm
> ------
>
>
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