Re: help with TCL function

From: Rolf Jentsch <RJentsch(at)electronicpartner(dot)de>
To: "Jules Alberts" <jules(dot)alberts(at)arbodienst-limburg(dot)nl>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: help with TCL function
Date: 2003-09-11 07:33:42
Message-ID: 200309110933.42388.rje@epmail.ep.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Am Donnerstag, 11. September 2003 08:59 schrieben Sie:
> Op 11 Sep 2003 (0:45), schreef ljb <lbayuk(at)mindspring(dot)com>:
...
> -- This is the function
>
> create or replace function tlow() returns trigger as '
> set NEW($1) [string tolower $NEW($1)]
> return [array get NEW]'
> language 'pltcl';
>
...

You could either test with info exists or catch the error
create or replace function tlow() returns trigger as '
if [info exists NEW($1)] {
set NEW($1) [string tolower $NEW($1)]
}
return [array get NEW]'
language 'pltcl';

create or replace function tlow() returns trigger as '
catch {
set NEW($1) [string tolower $NEW($1)]
}
return [array get NEW]'
language 'pltcl';

--
Rolf Jentsch
Produktentwicklung EDV-Anwendungen für Mitglieder
ElectronicPartner GmbH & Co. KG
Düsseldorf

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Caroline Yong 2003-09-11 08:15:59 how to replicate database
Previous Message Stéphane Cazeaux 2003-09-11 07:26:52 Re: Question about conccurrency control and Insert