Need help using function

Поиск
Список
Период
Сортировка
От Bob Pawley
Тема Need help using function
Дата
Msg-id F26B540AC1DD4C939AFA798A9802A73C@desktop
обсуждение исходный текст
Ответы Re: Need help using function  (John R Pierce <pierce@hogranch.com>)
Список pgsql-general
Hi
 
I want to try using functions but I am having trouble understanding return.
 
This is the function -
CREATE OR REPLACE FUNCTION p_id.ip_orient_3()
  RETURNS integer AS
$BODY$
 
 Begin
 
 Insert into fluids (fluid_id) values ('1') ;

  End;
  $BODY$
  LANGUAGE 'plpgsql' VOLATILE
  COST 100;
ALTER FUNCTION p_id.ip_orient_3() OWNER TO postgres;
 
This is how I am calling the function -
 
 select p_id.ip_orient_3();
 
The error message - "control reached end of function without RETURN"
 
I have attempted adding - Return integer; to the end of the function with no success.
 
Can anyone help me??
 
Bob
 

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

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: masking the code
Следующее
От: John R Pierce
Дата:
Сообщение: Re: Need help using function