funcion psql para obtener cantidad de expedientes por seccion, y estado

parent 8e7d99c5
CREATE OR REPLACE FUNCTION public.f_get_cantxseccion(character, integer, character, character)
RETURNS integer
LANGUAGE plpgsql
AS $function$DECLARE
p_cod_institucion alias for $1;
p_anho_expediente alias for $2;
p_cod_seccion alias for $3;
p_status alias for $4;
cnt_expedientes integer;
BEGIN
SELECT COUNT(*)
INTO cnt_expedientes
FROM detexpediente
WHERE codinstitucion = p_cod_institucion
AND anhoexpediente = p_anho_expediente
AND codseccion = p_cod_seccion
AND estadoseccion = p_status;
return cnt_expedientes;
END;$function$
;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment