rebuild_members — re-interpolate the MEMBERS table for an individual
int
rebuild_members
(
|
sname) ; |
char(3)
sname
;This procedure re-interpolates the MEMBERS table for a specific individual. The CENSUS table provides the data necessary to rebuild MEMBERS.
[276] Copying an individual's CENSUS rows into MEMBERS can be accomplished with code like the following:
BEGIN;
-- First remove existing census-like rows for individual "FOO"
DELETE FROM members
WHERE members.sname = 'FOO'
AND members.origin <> 'I';
-- Then copy rows from CENSUS to MEMBERS.
INSERT INTO members (sname, date, grp, origin, interp)
SELECT census.sname, census.date, census.grp, census.status, 0
FROM census
WHERE census.sname = 'FOO'
AND census.status <> 'A';
COMMIT;