Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Converting Paradox to DBIsam - TBatchMove and updates
Thu, Feb 21 2008 8:56 AMPermanent Link

Bob Murdoch
I have started on a rewrite of a section of an application that still uses Paradox tables.  This particular function does the following:

1. Pulls a list of orders into a Paradox table.  
2. Uses a TQuery to display a summary of these orders by customer code.

For instance:
select
  cast('' as varchar(5)) as Status_Code, customer_code, count(*)
from
  base_table


3. The user can update the dummy Status_Code field of the TQuery.
4. The underlying orders are updated via a TwwQBE query to reflect the new status code.

My questions:
1. Can I have an updatable dummy field in a query with DbIsam?
2. How can I update the list of orders (from #1 above) with the value in the dummy field of the query?

tia,

Bob M..
Thu, Feb 21 2008 10:20 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Bob

I think they are still in DBISAM but I'd suggest using a memory table.

select
  cast('' as varchar(5)) as Status_Code, customer_code, count(*)
into memory\tbl
from
  base_table

Then not only is the field updateable but you can use a simple bit of sql to return it to the disk table when the user clicks OK. I'd give you some example code but I always have to look in the manual to get it right - its a simple update and join though.

Roy Lambert
Thu, Feb 21 2008 1:06 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Bob,

<< 1. Can I have an updatable dummy field in a query with DbIsam? >>

Yes.

<< 2. How can I update the list of orders (from #1 above) with the value in
the dummy field of the query? >>

Roy's suggestion will work - dump the query to an in-memory table, and then
use an UPDATE with a join to re-update the main table:

http://www.elevatesoft.com/scripts/manual.dll?action=mantopic&id=dbisam4&product=d&version=7&category=3&topic=11

See the example for the UPDATE with the join on the above page.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image