Subject | add timestamp to text BLOB |
---|---|
Author | Rick Roen |
Post date | 2006-10-24T16:44:57Z |
FB 1.5.3
I must be making some obvious mistake here, but I can't see what.
I have the trigger below to add a username and timestamp to a blob
field.
SET TERM ^^ ;
CREATE TRIGGER CONTACTS_TIMESTAMP_NOTE FOR CONTACTS ACTIVE BEFORE
INSERT OR UPDATE POSITION 9 AS
/*
time stamp a Note field that is new or edited
*/
declare Str VarChar(8192);
begin
if ((INSERTING and NEW.NOTE is not null) or (UPDATING and OLD.NOTE
<> NEW.NOTE)) then
begin
Str = SubString(New.Note from 1 for 8190);
Str = Str ||' (***' || CURRENT_USER || ' ' || CURRENT_TIMESTAMP
|| ' ***)';
//exception E_Exception Str;
NEW.NOTE = Str;
end
end
^^
SET TERM ; ^^
When I post new text to the BLOB the user and timestamp info is not
there. When I uncomment the exception the Str variable holds the
correct BLOB string + Username and timestamp so I know the trigger
has been triggered properly.
What am I missing?
Rick
I must be making some obvious mistake here, but I can't see what.
I have the trigger below to add a username and timestamp to a blob
field.
SET TERM ^^ ;
CREATE TRIGGER CONTACTS_TIMESTAMP_NOTE FOR CONTACTS ACTIVE BEFORE
INSERT OR UPDATE POSITION 9 AS
/*
time stamp a Note field that is new or edited
*/
declare Str VarChar(8192);
begin
if ((INSERTING and NEW.NOTE is not null) or (UPDATING and OLD.NOTE
<> NEW.NOTE)) then
begin
Str = SubString(New.Note from 1 for 8190);
Str = Str ||' (***' || CURRENT_USER || ' ' || CURRENT_TIMESTAMP
|| ' ***)';
//exception E_Exception Str;
NEW.NOTE = Str;
end
end
^^
SET TERM ; ^^
When I post new text to the BLOB the user and timestamp info is not
there. When I uncomment the exception the Str variable holds the
correct BLOB string + Username and timestamp so I know the trigger
has been triggered properly.
What am I missing?
Rick