Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f9H4ZJP97136 for ; Wed, 17 Oct 2001 00:35:19 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f9H4NTE97464 for pgsql-sql@postgresql.org; Wed, 17 Oct 2001 00:23:30 -0400 (EDT) (envelope-from news) From: "Steven Dahlin" X-Newsgroups: comp.databases.postgresql.sql Subject: nvl() function Date: Tue, 16 Oct 2001 21:10:04 -0600 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 21 Message-ID: <9qj13u$2v5l$1@news.tht.net> X-Complaints-To: scrappy@hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2462.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000 To: pgsql-sql@postgresql.org X-Archive-Number: 200110/233 X-Sequence-Number: 5188 I am trying to find the equivalent in Postgresql to the Oracle sql function nvl(). With nvl() you give two parameters. The first may be a field/column or variable. If the value is not null then it is returned by the function. For example the with query below if the :ClientParameter is passed then only those rows which have a clientdesc matching the parameter are returned. If the :ClientParameter is null then those rows which have clientdesc = clientdesc are returned (all rows): select clientid, clientdesc from clients where ( clientdesc = nvl( :ClientParameter, clientdesc ) ) I have looked thru all the documentation I could find but nowhere were any built-in SQL functions delineated. Does anyone know where the documentation can be found? Thanks, Steve