Re: Excluding null return values from functions - Mailing list pgsql-general

From Pavel Stehule
Subject Re: Excluding null return values from functions
Date
Msg-id 162867790911250403i7f730624qc52e493e39fd60dc@mail.gmail.com
Whole thread Raw
In response to Excluding null return values from functions  (Jason Armstrong <ja@riverdrums.com>)
List pgsql-general
2009/11/25 Jason Armstrong <ja@riverdrums.com>:
> How do I give a condition on the return value of a function (for
> example plperl)?
>
> I have a perl search function that returns either a bigint, or undef
> if nothing is found. I want to exclude the undef/null return values
> from my select statement, something like:
>
> sql> select search(data, 'field', 'value') as result from mydata where
> result is not null;

select result from (select  search(data, 'field','value') as result
from mydata) x where result is not null;

regards
Pavel Stehule

>
> --
> Jason Armstrong
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

pgsql-general by date:

Previous
From: Jason Armstrong
Date:
Subject: Excluding null return values from functions
Next
From: John Oyler
Date:
Subject: Re: Re: I need help creating a composite type with some sort of constraints.