Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: [GENERAL] Trigger problem

From: A. Kretschmer <andreas.kretschmer(at)schollglas.com>
Date: Tue Nov 27 2007 - 04:53:36 EST


am Tue, dem 27.11.2007, um 10:38:09 +0100 mailte Christian Rengstl folgendes:
> Hi list,
>
> act = 'DELETION of row with id: ' || OLD.id;
> act = 'UPDATE OF ' || field || ' with id: ' ||
> ...
> INSERT INTO history(aennam, action, table_name) VALUES(current_user,
> act, tab);
>
> Now the problem is that a tuple gets added to the table history, but
> the field "action" (whatever the user did) is 99% empty, whereas the
> others are filled and I don't see why...
>
> Any hint is greatly appreciated

Maybe sometime the concateneted fields (e.g. field, OLD.id) contains NULL-values. If so, the complete string 'act' will be NULL.

Solution: use coalesce(field,''). Hope that helps.

Andreas

-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   
http://wwwkeys.de.pgp.net

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend
Received on Tue Nov 27 04:55:46 2007

This archive was generated by hypermail 2.1.8 : Mon Jun 16 2008 - 20:36:59 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library