From: Rodrigo De León <rdeleonp@gmail.com>
To: Norm Garand <indianlakesolutions@rogers.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Inserting an IF statement in the middle of a SELECT in pl/pgSQL code
Date: Tue, 17 Jul 2007 23:46:44 -0500
Message-ID: <a55915760707172146n75dbf69btff374c054282bdbf@mail.gmail.com> (raw)
In-Reply-To: <52149.39195.qm@web88311.mail.re4.yahoo.com>
References: <52149.39195.qm@web88311.mail.re4.yahoo.com>
On 7/17/07, Norm Garand <indianlakesolutions@rogers.com> wrote:
> /---------------
> IF $7 IS NOT NULL THEN
> AND f.id = pid.specific_location_cid AND f.long_desc = $7
> END IF
> ---------------/
How about:
AND f.ID = pid.specific_location_cid
AND f.long_desc = COALESCE ($7, f.long_desc)
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-sql@postgresql.org
Cc: rdeleonp@gmail.com, indianlakesolutions@rogers.com
Subject: Re: Inserting an IF statement in the middle of a SELECT in pl/pgSQL code
In-Reply-To: <a55915760707172146n75dbf69btff374c054282bdbf@mail.gmail.com>
* 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