Search Postgresql Archives

Re: Pgsql dynamic statements and null values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 08, 2005 at 04:30:54PM -0600, Guy Rouillier wrote:
> This is such a common usage pattern that I'm pretty sure I'm missing
> something basic.  Pgsql provides quote_literal to aid with inserting a
> literal string into a dynamically prepared statement.  My opinion is
> that quote_literal should handle nulls as well, but if quote_literal
> can't be changed for historical reasons, then providing another function
> like check_null below would be very useful.  Basically, such a function
> should supply the value NULL if the incoming value is null, or the
> incoming value otherwise.

Lookup the COALESCE and NULLIF functions.

Have a nice day,
-- 
Martijn van Oosterhout   <kleptog@xxxxxxxxx>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment: pgpPF8kfhsirW.pgp
Description: PGP signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux