How to detect if any rows were returned in plpgsql function?

From: A B <gentosaker(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: How to detect if any rows were returned in plpgsql function?
Date: 2010-11-17 07:46:41
Message-ID: AANLkTi=iJpu2==szfF-OnUzSXqiCEw=zOQhDdMOFW5qw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hello.

If I write two functions (with appologies for any syntax error)

create function bar() returns set of integer language plpgsql as $$
begin
return query select something.....;
end; $$;

create function foo() returns set of integer language plpgsql as $$
begin
return query select * from bar();
end; $$;

how can I before the function foo ends, check if I got any data back
from the call to bar() ?

Browse pgsql-novice by date

  From Date Subject
Next Message Majid Azimi 2010-11-17 09:14:07 Actual Table Data
Previous Message Michael Rau 2010-11-16 22:18:32 Re: ALTER DEFAULT PRIVs / not working for me