Re: Referencing Tables from within blocks

From: mjc <cavett_at_globalnet.co.uk>
Date: 1997/03/30
Message-ID: <01bc3d32$d73ba240$a9567ec2_at_cavett.globalnet.co.uk>#1/1


Option 1



Try using a POST-INSERT, POST-DELETE trigger on your control block that contains a reference to form level procedure that contains an insert statement into your unrelated log table.

This assumes you're inserting, deleting records in the control bock table (which seems unusual). Is that right??
For example:

Create a procedure called 'ins_log':

PROCEDURE ins_log (p_action IN CHAR) IS
/* where p_action is INSERT/DELETE */

	INSERT INTO log_tablename

(log_user,
log_time, log_action) VALUES
(USER
,SYSDATE ,p_action);

POST-INSERT block level trigger on the control block: /* 1 line call */
ins_log(INSERT);

OPTION 2



An alternative to building the functionality into your form is to build it into the database with a row level database trigger (on INSERT or DELETE) on your base table to insert audit records into your log table. This has the advantage of firing from any environment including SQL*Plus whatever. . Received on Sun Mar 30 1997 - 00:00:00 CET

Original text of this message