Dear expert,
I want to see who has been editing data in my versioned Feature Class by applying trigger on A and D table. But I found some interesting things:
First off all i create a table "whoisediting" to store the username, feature being edited, editing time and stateid.
Say I have A65 and D65 and my triggers are :
CREATE OR REPLACE TRIGGER A65_after_insert AFTER INSERT ON sde.A65
FOR EACH ROW
DECLARE
v_username varchar2(10);
v_time varchar2(30);
BEGIN
SELECT user INTO v_username
FROM dual;
SELECT TO_CHAR(SYSDATE, 'DD-MON-YY HH24:MI:SS') INTO v_time
FROM dual;
INSERT INTO sys.whoisediting (tabelname, username, time,stateid) VALUES ('fc1_insert', v_username, v_time,:NEW.SDE_STATE_ID);
END A65_after_insert;
.
run;
Then I do :
1. I start to edit my FC1 feature class via ArcMap. I draw a line (without clicking 'Stop Editing').
2. run this query 'select count(*) from whoisediting;' and It says there are TWO records.
3. I update one of the field
4. run this query 'select count(*) from whoisediting;' and It says there are FIVE records. [This means that UPDATING will add another 3 records in A table]
5. then I click 'Stop Editing' (and save the edit).
6. run this query 'select count(*) from whoisediting;' and It says there are SEVEN records. [This means that SAVING will add another 2 records in A table]
This happens when I add single object/record. I cant imagine editing a really huge data with many objects/record. This A table will really really explode....
My questions:
1. Why does this drawing/editing process add so many records to A table ? Isn't 1 record just enough (thats what it says in the training module)...?
2. How can I see who has edited/added data to my feature class ?
Thanks