binding a variable to NULL in perl-DBD

From: Max Pyziur <pyz(at)brama(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: binding a variable to NULL in perl-DBD
Date: 2013-08-21 21:06:26
Message-ID: alpine.LRH.2.03.1308211655440.1058@brama.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces


Greetings,

I'm trying to determine how to pass "NULL" to a variable, specifically in
the conditional section of a SQL statement:

SELECT moo
FROM foo aa
WHERE field1 = ?
AND field2 = ?

Sometimes at the command line, when running the perl-DBD script, I would
like the select statement to reflect:

SELECT moo
FROM foo aa
WHERE field1 = 'goo'
AND field2 IS NULL

Much thanks in advance,

Max Pyziur
pyz(at)brama(dot)com

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Daniel Verite 2013-08-22 20:48:55 Re: binding a variable to NULL in perl-DBD
Previous Message Alvaro Herrera 2013-07-23 19:57:07 Re: Issue in Postgre Driver Installation