Re: Forms/Designer question
Date: Fri, 22 Oct 1999 23:21:57 GMT
Message-ID: <7uqrii$m8v$1_at_nnrp1.deja.com>
Steve,
First, you need to add a column to your table to hold the user ID.
We make ours VARCHAR2(20), but it must be VARCHAR2 and big enough to
hold the ID.
Once this is done, put in a Form level When-New_Form-Instance trigger
on your form containing:
BEGIN
SELECT USER
INTO :GLOBAL.USER_ID
FROM DUAL;
END;
[Quoted] (The "DUAL" table exists on every Oracle database, it is meant to be
used for things like this)
Next, create an item on the block for your table with the name of the column, set the DISPLAYED property of this item to NO. Finally, add PRE-INSERT and a PRE-UPDATE triggers Block level triggers to the table's block like this:
BEGIN
:your_table_name.your_modified_by_column_name := :GLOBAL.USER_ID;
END;
These triggers will populate the column before the insert or update is
performed.
Paul
In article <38118e00.60818832_at_news.texas.net>,
howlin_wolf_at_hotmail.com (Steve Macmillan) wrote:
>
> I've created a form and I want to add a "Modified By" field so when
> the database is updated the person who modified it (or their login)
> will automatically appear in that field.
>
> Thanks !
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Sat Oct 23 1999 - 01:21:57 CEST