function returning NULL? - Mailing list pgsql-interfaces

From Sandro Dentella
Subject function returning NULL?
Date
Msg-id 20010430105600.B6311@bluff.ermit.it
Whole thread Raw
Responses Re: function returning NULL?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-interfaces
I'm trying to create a function that should return a date, and occasionally
NULL value. I can't see how to do that. I'm using pl/tcl.

CREATE FUNCTION "start" (text,text) RETURNS date AS '    regsub ^. $1 "$2" job    spi_exec "select start_date from jobs
wherejob_code = ''$job''" { if {[info exist start_date]} {      return $start_date }    }
 
#     return "2/2/2222"  HERE I want NULL    return "2/2/2222"
'LANGUAGE 'pltcl';

That is to say I'd like to have a function that returns a date but under
some circumstancies it leave it blanck.

TIA
sandro
*:-)


-- 
Sandro Dentella  *:-)
e-mail: sandro@ermit.it sandro.dentella@mi.infn.it 


pgsql-interfaces by date:

Previous
From: Sandro Dentella
Date:
Subject: Re: libpgtcl and passwords
Next
From: Constantin Teodorescu
Date:
Subject: Re: MULTIPLE OUTER JOIN SYNTAX :-( can't quess it