Re: How can I create null value from function call with no results? - Mailing list pgsql-general

From Marc Mamin
Subject Re: How can I create null value from function call with no results?
Date
Msg-id B6F6FD62F2624C4C9916AC0175D56D8828AC3CEF@jenmbs01.ad.intershop.net
Whole thread Raw
In response to Re: How can I create null value from function call with no results?  (Seref Arikan <serefarikan@gmail.com>)
List pgsql-general
> I want to call a function using a column of a table as the parameter and
> return the parameter and function results together.
> The problem is, when the function returns an empty row my select statement
> that uses the function returns an empty row as well.

Hello,
not sure if it makes sense in your context, but something like this could do the job:

WITH SEL AS ( Your Query)
SELECT * FROM SEL
UNION ALL
SELECT  'nothing found' WHERE NOT EXISTS ( select * from sel);

regards,

Marc Mamin

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Postgress Doubts
Next
From: Kynn Jones
Date:
Subject: How to implement a uniqueness constraint across multiple tables?