Board index » delphi » Sorting on calculated field issue

Sorting on calculated field issue

Hi,

I use Paradox tables and have come across the sorting problem on calculated
fields ie it cannot be done because you can't create an index on a
calculated field.  I have used the common technique of creating a physical
sort field which is filled through a sort process, and use this physical
field for the sort.

The problem with this method is muti-user, it cannot accomodate multi-users
as the physical table will be sorted by whatever the last person sorted it
by.

My question,  how have others accomplished this?  Would it be advantageous
to change to another database (eg Advantage), would this solve the problem
considering I have some reasonably complex calculations going on?

Any feedback greatly appreciated.

Alex

 

Re:Sorting on calculated field issue


Quote
>My question,  how have others accomplished this?  Would it be advantageous
>to change to another database (eg Advantage), would this solve the problem
>considering I have some reasonably complex calculations going on?

One way would be to use a TclientDataset.  A TclientDataset is an in memory
table and it does support indexing on calculated fields.  Of course you do need
to have the Clientserver version of Delphi to get the Tclientdataset

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:Sorting on calculated field issue


Quote
A Vasitch wrote:

> I use Paradox tables and have come across the sorting problem on calculated
> fields ie it cannot be done because you can't create an index on a
> calculated field.  

In some places I use Query, for example to show data sorted according
to some simple calculated field, "SellPrice - Cost", on DBGrid.

User can click the selected record on Grid to start updating something.
Then I use for example other DbEdit -controls connected to the same
database via TTable, and write the new data in.

Markku Nevalainen

Re:Sorting on calculated field issue


Hi.

If you dont have Delphi C/S (Then no TClientDataset) you could use an
alternative memory table component. Have a look at
http://www.cam.org/~abrunet . You'll find what you need.

Alain Brunet.

Quote
A Vasitch wrote in message <769ei4$o...@forums.borland.com>...
>Hi,

>I use Paradox tables and have come across the sorting problem on calculated
>fields ie it cannot be done because you can't create an index on a
>calculated field.  I have used the common technique of creating a physical
>sort field which is filled through a sort process, and use this physical
>field for the sort.

>The problem with this method is muti-user, it cannot accomodate multi-users
>as the physical table will be sorted by whatever the last person sorted it
>by.

>My question,  how have others accomplished this?  Would it be advantageous
>to change to another database (eg Advantage), would this solve the problem
>considering I have some reasonably complex calculations going on?

>Any feedback greatly appreciated.

>Alex

Re:Sorting on calculated field issue


Hi.

If you dont have Delphi C/S (Then no TClientDataset) you could use an
alternative memory table component. Have a look at
http://www.cam.org/~abrunet . You'll find what you need.

Alain Brunet.

Other Threads