Re: help with TCL function - Mailing list pgsql-general

From Richard Huxton
Subject Re: help with TCL function
Date
Msg-id 200309101803.13890.dev@archonet.com
Whole thread Raw
In response to help with TCL function  ("Jules Alberts" <jules.alberts@arbodienst-limburg.nl>)
List pgsql-general
On Wednesday 10 September 2003 14:27, Jules Alberts wrote:
>
> I use it to force lowercase of values inserted in the db. There is one
> problem though, if the parameter is absent, the function will give an
> error message. I would like it to rather check for null before tolower
> is applicated. In semicode:
>
> if ($1 <> NULL) {
>     set NEW($1) [string tolower $NEW($1)]
> }
> return [array get NEW]'
>
> but I have no idea how to do this in TCL. Can somebody please tell me?
> Thanks a lot!

According to the manuals:

$NEW

    An associative array containing the values of the new table row for
INSERT/UPDATE actions, or empty for DELETE. The array is indexed by field
name. Fields that are NULL will not appear in the array!

Is that any use?

--
  Richard Huxton
  Archonet Ltd

pgsql-general by date:

Previous
From: Andrew Ayers
Date:
Subject: Re: Picture with Postgres and Delphi
Next
From: Tom Lane
Date:
Subject: Re: 7.4 defaulting to ipv6 ?