Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Attaching a cursor to a CA
Message
From
19/05/2017 17:07:04
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01651181
Message ID:
01651246
Views:
43
>Let me describe what I was trying to do (initially) and how/why I changed my mind.
>
>I have a procedure where the user selects any number of records in a Parent table. Then, in the WHILE look, the program has to update many Child tables (adding, changing, deleting). Initially I wanted to have each Child table records of all Parent records. So that I would have just ONE TableUpdate(). This would be nice but, I decided, not practical.
>1. For any Child table, it is very difficult to get All records for All Parent records. So I thought that, as the code goes from one Parent record to another, I would "get/add" records from the Child table. But this is not easy. Since, I found, that you cannot add records to the CA cursor incrementally. It has to be done one time.
>2. The other problem is that the resulting CA cursor (or any Child table) can be so big that it may be a problem to update the DB table (in TableUpdate()). For example, it theory, a Child table could end up having, say 10,000 rows. I have never done updates from CA cursors that big.
>3. So I decided that each Parent record will be processed, Child tables will be updated, TableUpdate() for the Parent and Child will be fired.
>4. Then the Parent pointer will go to the next record.

OK, the whole thing makes sense now. Except "you cannot add records to the CA cursor incrementally" - with buffering at 5, you should be able to do that, as long as there's no tableupdate() before you're completely done.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform