Need help using function

From: "Bob Pawley" <rjpawley(at)shaw(dot)ca>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Need help using function
Date: 2009-06-26 17:09:55
Message-ID: F26B540AC1DD4C939AFA798A9802A73C@desktop
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2009-06-26 17:15:33 Re: Need help using function
Previous Message David Fetter 2009-06-26 16:35:08 Re: masking the code