Actually, I suppose I could do: CREATE TRIGGER EXTENDED_TEXT_DEL FOR EXTENDED_TEXT ACTIVE BEFORE DELETE POSITION 10 AS begin insert into audit_trail values (null, null, null, 45, 1, old.Extended_Text_Type||"|"|| old.Foreign_Id||"|"|| old.Extended_Text_Sequence_No, old.Extended_Text_Type||"|"|| old.Foreign_Id||"|"|| old.Extended_Text_Sequence_No||"|"|| old.Free_Text, null ); END
replacing the missing fields with null. Should that work? RBS On Wed, Nov 16, 2011 at 8:55 AM, Bart Smissaert <[email protected]>wrote: > I don't think that can work as the receiving table has other fields: > > CREATE TABLE AUDIT_TRAIL( > AUDIT_ID INTEGER NOT NULL, > AUDIT_TIME TIMESTAMP, > USER_ID VARCHAR(12), > TABLE_ID SMALLINT, > ACTION SMALLINT, > PRIMARY_KEY VARCHAR(128), > DATA VARCHAR(5000), > PATIENT_ID INTEGER) > > > RBS > > On Wed, Nov 16, 2011 at 6:58 AM, Pavle <[email protected]> wrote: > >> ** >> >> >> >> Hi ! >> >> --- In [email protected], Bart Smissaert <bart.smissaert@...> >> wrote: >> > >> > Running Firebird 1.5, classic, dialect 1 on Windows and trying to >> > create a trigger like this: >> > >> > CREATE TRIGGER EXTENDED_TEXT_DEL FOR EXTENDED_TEXT >> > ACTIVE BEFORE DELETE >> > POSITION 10 >> > AS >> > begin >> > insert into audit_trail >> > (Table_Id,"Action",Primary_Key,data) >> > values (45, 1, >> > old.Extended_Text_Type||"|"|| >> > old.Foreign_Id||"|"|| >> > old.Extended_Text_Sequence_No, >> > old.Extended_Text_Type||"|"|| >> > old.Foreign_Id||"|"|| >> > old.Extended_Text_Sequence_No||"|"|| >> > old.Free_Text >> > ); >> > END >> >> if you know all fielda (structure) and provide values >> insert into audit_trail values(...) >> >> >> > > [Non-text portions of this message have been removed] ------------------------------------ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Visit http://www.firebirdsql.org and click the Resources item on the main (top) menu. Try Knowledgebase and FAQ links ! Also search the knowledgebases at http://www.ibphoenix.com ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/firebird-support/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/firebird-support/join (Yahoo! ID required) <*> To change settings via email: [email protected] [email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
