I get a problem to create stored procedure in postgresql with multiple select, this is error that I get
ERROR: function result type must be specified SQL state: 42P13
and this is my query:
create or replace function user_info(
functn integer
)
language sql
as
$$
begin
if(functn = 1) then
select email, user_name, address from user;
else if(functn = 2) then
select email, member_name, phone from member;
else
select email, admin_name, post_code from admin;
end if;
end
$$;
please anyone help me to solve this problem, thanks.
CREATE FUNCTIONwithout aRETURNSclause. (And also, your function doesn't do anything and returns nothing)