pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sandro Dentella <sandro.dentella@tin.it>
To: pgsql-interfaces@postgresql.org
Subject: function returning NULL?
Date: Mon, 30 Apr 2001 10:56:00 +0200
Message-ID: <20010430105600.B6311@bluff.ermit.it> (raw)

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 where job_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 



view thread (2+ messages)  latest in thread

Message-ID: <20010430105600.B6311@bluff.ermit.it>
Permalink:  ../20010430105600.B6311@bluff.ermit.it/
Also on:    postgresql.org/message-id/20010430105600.B6311@bluff.ermit.it

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: sandro.dentella@tin.it
  Subject: Re: function returning NULL?
  In-Reply-To: <20010430105600.B6311@bluff.ermit.it>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox