Subject | Re: [ib-support] Creation date |
---|---|
Author | Helen Borrie |
Post date | 2001-06-04T12:57:19Z |
At 05:18 AM 04-06-01 -0700, you wrote:
Include a Timestamp column in your table and fill it with a trigger. Here a couple of triggers I have for tables in my databases:
create trigger Mem_LogInsert for Members
active before insert position 0 as
begin
NEW.CREATIONDATE=CURRENT_TIMESTAMP;
if (NEW.LASTUPDATE IS NULL) then
NEW.LASTUPDATE=CURRENT_TIMESTAMP;
if ((NEW.UPDATEDBY IS NULL)
or (NEW.UPDATEBY='')) then
NEW.UPDATEDBY=USER;
end
create trigger Mem_LogUpdate for Members
active before update position 0 as
begin
NEW.LASTUPDATE=CURRENT_TIMESTAMP;
NEW.UPDATEDBY=USER;
end
You can write a little slave program that creates the script for you!
Cheers,
Helen
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________
>Hello.Duleep,
>
>I need to know how to get the internal date of
>creation / change of a record in IB 6.0., eg
>
>list of all transaction updated today
>
>
Include a Timestamp column in your table and fill it with a trigger. Here a couple of triggers I have for tables in my databases:
create trigger Mem_LogInsert for Members
active before insert position 0 as
begin
NEW.CREATIONDATE=CURRENT_TIMESTAMP;
if (NEW.LASTUPDATE IS NULL) then
NEW.LASTUPDATE=CURRENT_TIMESTAMP;
if ((NEW.UPDATEDBY IS NULL)
or (NEW.UPDATEBY='')) then
NEW.UPDATEDBY=USER;
end
create trigger Mem_LogUpdate for Members
active before update position 0 as
begin
NEW.LASTUPDATE=CURRENT_TIMESTAMP;
NEW.UPDATEDBY=USER;
end
You can write a little slave program that creates the script for you!
Cheers,
Helen
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________