Re: Forms/Designer question
Date: Fri, 29 Oct 1999 09:38:04 +0200
Message-ID: <7vbigt$ddc$2_at_news.worldcom.ch>
better do it on the server side:
--CREATION (with auto ID if null)
create or replace trigger t_adr_bef_insert
before insert on ore.t_adr
for each row
declare
new_id number;
v_username varchar2(3);
v_date date;
begin
if :new.adr_id is null then
select s_t_adr.nextval
into new_id from dual;
:new.adr_id := new_id;
end if;
select user, sysdate
into v_username,v_date
from dual;
:new.created_by:=v_username;
:new.creation_date := v_date;
END;
/
- MODIFICATION
for each row
declare
v_username varchar2(3);
v_date date;
begin
select user, sysdate
into v_username,v_date
from dual;
:new.modified_by:= v_username;
:new.modif_date := v_date;
END;
/
Olivier Régis
MCSE+I, OCP
Switzerland
Steve Macmillan <howlin_wolf_at_hotmail.com> wrote in message
news:38118e00.60818832_at_news.texas.net...
>
> 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 !
>
>
Received on Fri Oct 29 1999 - 09:38:04 CEST