From: | darren(at)crystalballinc(dot)com |
---|---|
To: | Keow Yeong Huat Joseph <jkeowyh(at)singtel(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: function call |
Date: | 2003-09-15 01:21:44 |
Message-ID: | Pine.LNX.4.44.0309142119020.19618-100000@thread.crystalballinc.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
create or replace function test(integer) returns boolean as '
declare
number alias for $1;
begin
if number = 0 then
return false;
else
return true;
end if;
end;' language 'plpgsql';
to call the function you can
SELECT test(1);
or can do
SELECT user_id,
user_name,
test(user_id) AS test
FROM users
or you can call from another function or from code.
Depending on where you wish to call the function / sp.
HTH
Darren
On Mon, 15 Sep 2003, Keow Yeong Huat Joseph wrote:
> Hi,
>
> Would anyone able to advise how can I call a function/Stored procedure? what command to issue?
>
> Thanks.
>
>
> Best Regards
>
> _______________________
>
> Joseph Keow
>
>
--
Darren Ferguson
From | Date | Subject | |
---|---|---|---|
Next Message | Christopher Browne | 2003-09-15 01:42:40 | Re: How to remove CLUSTERs and 'partitioning tables' |
Previous Message | Keow Yeong Huat Joseph | 2003-09-15 01:18:57 | Re: function call |