Need help using function - Mailing list pgsql-general

From Bob Pawley
Subject Need help using function
Date
Msg-id F26B540AC1DD4C939AFA798A9802A73C@desktop
Whole thread Raw
Responses Re: Need help using function
List 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 by date:

Previous
From: David Fetter
Date:
Subject: Re: masking the code
Next
From: John R Pierce
Date:
Subject: Re: Need help using function