hi all
i have a function that's created sucessully but when i try to run it it gives me this error
ERROR: control reached end of function without RETURN
CONTEXT: PL/pgSQL function "test"
this is my function
CREATE OR REPLACE FUNCTION test(int8, varchar, varchar)
RETURNS void AS
'
declare
arg_userid ALIAS FOR $1;
arg_name ALIAS FOR $2;
arg_emailaddress ALIAS FOR $3;
begin
UPDATE table SET address = arg_emailaddress WHERE userid = arg_userid;
end;
'
LANGUAGE 'plpgsql' VOLATILE;
and when i run it i get the error
select * from test(123, '', 'email')
can anyone help me out
many thanks
i have a function that's created sucessully but when i try to run it it gives me this error
ERROR: control reached end of function without RETURN
CONTEXT: PL/pgSQL function "test"
this is my function
CREATE OR REPLACE FUNCTION test(int8, varchar, varchar)
RETURNS void AS
'
declare
arg_userid ALIAS FOR $1;
arg_name ALIAS FOR $2;
arg_emailaddress ALIAS FOR $3;
begin
UPDATE table SET address = arg_emailaddress WHERE userid = arg_userid;
end;
'
LANGUAGE 'plpgsql' VOLATILE;
and when i run it i get the error
select * from test(123, '', 'email')
can anyone help me out
many thanks