pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: MaXX <bs139412@skynet.be>
To: pgsql-sql@postgresql.org
Subject: Re: Help with optional parameters
Date: Fri, 22 Sep 2006 00:48:14 +0200
Message-ID: <eev4rk$2l3h$1@talisker.lacave.net> (raw)
In-Reply-To: <031936836C46D611BB1B00508BE7345D04AD244C@gatekeeper.daycos.com>
References: <031936836C46D611BB1B00508BE7345D04AD244C@gatekeeper.daycos.com>

Curtis Scheer wrote:
 > I noticed this one by searching in the archives, as I am working with 
some
 > "optional" parameters myself and noticed your solution. I just wanted to
 > make one improvement suggestion which is instead of checking whether 
or not
 > a parameter has been used simply start your query like so
 > Query_base := 'SELECT * FROM my_table WHERE 1 =1;
 > If you do that then you can just add on any parameters you need or 
not add
 > any at all. I think that seems to be a bit simpler than having a 
has_param"
 > Boolean variable.
True, I think I was too focused on the "clean" output, your solution 
wastes less cycles and is more readable...

Snipet updated,

Thanks,
--
MaXX



view thread (6+ messages)

Message-ID: <eev4rk$2l3h$1@talisker.lacave.net>
Permalink:  ../eev4rk$2l3h$1@talisker.lacave.net/
Also on:    postgresql.org/message-id/eev4rk$2l3h$1@talisker.lacave.net

 · 

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-sql@postgresql.org
  Cc: bs139412@skynet.be
  Subject: Re: Help with optional parameters
  In-Reply-To: <eev4rk$2l3h$1@talisker.lacave.net>

* 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