Re: if-clause to an exiting statement - Mailing list pgsql-general

From Jasen Betts
Subject Re: if-clause to an exiting statement
Date
Msg-id ieeoqt$j8e$2@reversiblemaps.ath.cx
Whole thread Raw
In response to if-clause to an exiting statement  (Kobi Biton <kobi@comns.co.il>)
Responses Re: if-clause to an exiting statement  (Rob Sargent <robjsargent@gmail.com>)
List pgsql-general
On 2010-12-07, Kobi Biton <kobi@comns.co.il> wrote:
> hi i am a newbie to sql statments  , I am running postgres 8.1 with
> application called opennms version 1.8.5 due to an application bug
> queries that I execute aginst the DB which returns raw-count=0 are being
> ignored and will not process a certain trigger I need to process.

I think you want this:

 ORIGINAL QUERY
 union
   select DUMMY ROW DATA
 where
   not exists ( ORIGINAL QUERY )


you need to return something to get a rowcount of 1 this is what the
dummy row data provides. the "where not exists" part blocks the dummy
row data when the main query returns something.

--
⚂⚃ 100% natural

pgsql-general by date:

Previous
From: Jasen Betts
Date:
Subject: Re: How to obtain the maximum value of a date, between 3 tables...
Next
From: Sandeep Srinivasa
Date:
Subject: Re: Simple, free PG GUI/query tool wanted