Maintaining Log at User level [message #159551] |
Mon, 20 February 2006 04:28 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
manyal
Messages: 84 Registered: March 2005
|
Member |
|
|
Dear Friend,
I want to have log (which maintains the user who is going to update the record)for each and every updation of records.for this every user is provided with one user code to be stored at table while updation.
so what are the most suitable triggers at block level to accomplish this requirenment.
Thanx in Advance
|
|
|
|
Re: Maintaining Log at User level [message #159675 is a reply to message #159656] |
Mon, 20 February 2006 21:58 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
manyal
Messages: 84 Registered: March 2005
|
Member |
|
|
Dear DJartin,
I m using form 6i as a front end and i also tried with triggers like when validate record and Post record but these triggers fires even i execute the record without updating it .
Manyal
|
|
|
|
|
|
|
Re: Maintaining Log at User level [message #159883 is a reply to message #159551] |
Wed, 22 February 2006 01:40 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
rnemkul
Messages: 35 Registered: February 2006
|
Member |
|
|
Here is a example below so you see the example
You have to write Condition for each and every column contaning on table. what you want to store log
CREATE OR REPLACE TRIGGER TRIG_adit
AFTER INSERT OR DELETE ON <TABLE_NAME>
REFERENCING NEW AS NEW OLD AS OLD FOR EACH ROW
BEGIN
IF INSERTING THEN
IF :NEW.<COL_NAME1> IS NOT NULL THEN THEn
INSERT INTO adit_TABLE(col1,col2)
VALUES('a','b');
END IF;IF :NEW.<COL_NAME2> IS NOT NULL THEN THEn
INSERT INTO adit_TABLE(col1,col2)
VALUES('a','b');
END IF;
ELSIF UPDATING THEN
IF :NEW.<COL_NAME1> IS NOT NULL AND :NEW.<COL_NAME><>:OLD.<COL_NAME> THEN THEn
INSERT INTO adit_TABLE(col1,col2)
VALUES('a','b');
END IF;
IF :NEW.<COL_NAME2> IS NOT NULL AND :NEW.<COL_NAME><>:OLD.<COL_NAME> THEN THEn
INSERT INTO adit_TABLE(col1,col2)
VALUES('a','b');
END IF;
END IF;
END;
Regards
Rajendra
|
|
|
|
|
|
Re: Maintaining Log at User level [message #160111 is a reply to message #160093] |
Thu, 23 February 2006 05:34 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
manyal
Messages: 84 Registered: March 2005
|
Member |
|
|
Dear rajendra,
i m having one data entry form which can be run only by authenticated users.
whenever user run form and do data entry user code is assigned to modified_by column to maintain log (user code is derived from the authenticated entry,every user is provided with a login name and password).
suppose next time another user is doing entry than new user code is overwritten to the modified_by column.
my problem is that new user is overwritten everytime whereas i want it to be overwriiten only in the case of updation and not in the case when user is just querying the record.
Manyal
|
|
|
|