Subject RE: [firebird-support] Clear memo field to null in trigger
Author Carrell Alex
firebird-support@yahoogroups.com

Hi,

not the best way, flawed but.

SET TERM ^ ;
CREATE OR ALTER TRIGGER
ACTIVE BEFORE UPDATE POSITION 0
AS
BEGIN
if (NEW.memovalue is not null ) then
begin
IF rtrim(substring(NEW.memovalue from 0 for 500)= '' then
NEW.memovalue = null
end
END
^


SET TERM ; ^

This should work with firebird 1.5 out of the box.

alex


|-----Original Message-----
|From: firebird-support@yahoogroups.com
|[mailto:firebird-support@yahoogroups.com] On Behalf Of Nols Smit
|Sent: 09 November 2007 12:45
|To: firebird-support@yahoogroups.com
|Subject: [firebird-support] Clear memo field to null in trigger
|
|Hi,
|
|In Delphi, to clear a certain memo field, I use the following code:
|
| if Trim(IBORegisterMEMADDRESS.AsString) = '' then
| IBORegisterMEMADDRESS.Clear;
|
|I would like to clear the ADDRESS memo field using a trigger.
|
|A hint or code snipped will be appreciated.
|
|
|Regards,
|
|Nols Smit
|
|
|
|Disclaimer Legal Notice:
|By having opened and read this electronic mail, you are deemed to have
|understood and accepted all disclaimers and conditions pertaining to
|electronic mail emanating from, and received by The Council
|for Geoscience,
|further detail of which may be viewed at the following hyperlink:
|http://www.geoscience.org.za/disclaimer.htm
|
|
|
|
|[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
|
|
|
|