Re: function call

Поиск
Список
Период
Сортировка
От Keow Yeong Huat Joseph
Тема Re: function call
Дата
Msg-id 6D76C3AAF21F9A4487D1F3D84982B3AF01546E77@EMHQ05B.singtel.corp.root
обсуждение исходный текст
Ответ на function call  ("Keow Yeong Huat Joseph" <jkeowyh@singtel.com>)
Список pgsql-general
Thank you.

Calling from java code, is the same as:

select test(1);

Regards
Joseph

-----Original Message-----
From: darren@crystalballinc.com [mailto:darren@crystalballinc.com]
Sent: Monday, September 15, 2003 9:22 AM
To: Keow Yeong Huat Joseph
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] function call


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


В списке pgsql-general по дате отправления:

Предыдущее
От: darren@crystalballinc.com
Дата:
Сообщение: Re: function call
Следующее
От: "Relaxin"
Дата:
Сообщение: Re: case-insensitive database