Amigos les quiero pedir ayuda, soy un novato q quiere empezar a trabajar con Postgres, TE go el siguiente codigo como function:
Código PHP:
CREATE OR REPLACE FUNCTION "public"."p_accesousuario" (v_usu_id char) RETURNS varchar AS
$body$
BEGIN
select 1 from sc_usuario
where usu_id = v_usu_id ;
if not found THEN
return "Valido";
else
return "Invalido";
end if;
END;
$body$
LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;
he intento llamarlo de la siguiente manera:
Código PHP:
select * from p_accesousuario("carlos");
y el resultado de este es:
Código PHP:
ERROR: column "carlos" does not exist at character 31
les agradeceria su ayuda.