Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remote View Data Duplication
Message
From
10/12/2023 22:10:57
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
 
 
To
10/12/2023 21:23:51
Kato Ba
Bytex Technologies Limited
Kaduna, Nigeria
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01687405
Message ID:
01687418
Views:
43
>>cGUID - Uniquely identifies the record in the entire table.
>>cEmpId - Unique Id of the Employee (This could be duplicated within the table, depending on the number of Earning/Deduction Id for the employee)

To work on a month or year for all the employees at once, you'd need to pull that whole dataset, then locate for records and add if required. But that's a bad idea for SQL, especially if there's large numbers of records. You are supposed to break data into logical manageable subsets to work on just those records.

Example: break the task into rows per employee by making the RV constraint cEmpid=?m.lcEmployee. Then iterate through each employee and requery the RV to get all their records. Update/append, Tableupdate(), next employee. Also think about transactions if it matters if things fail part way through the payroll run.

If you are sure you know what the cGUID would be for each employee record, then you could use the current view, requerying for each expected row. However, if cGUID is random or you need to sum values in multiple fields, then consider whether you definitely need cGUID when you've got an Identity field as well as other fields you can use to pull data. Make id your RV update key if you can.
"... They ne'er cared for us
yet: suffer us to famish, and their store-houses
crammed with grain; make edicts for usury, to
support usurers; repeal daily any wholesome act
established against the rich, and provide more
piercing statutes daily, to chain up and restrain
the poor. If the wars eat us not up, they will; and
there's all the love they bear us.
"
-- Shakespeare: Coriolanus, Act 1, scene 1
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform