altocompta/sql/trunk/05_card_class_base.sql
2010-04-14 22:26:40 +00:00

24 lines
662 B
PL/PgSQL

-- Function: comptaproc.card_class_base(integer)
-- DROP FUNCTION comptaproc.card_class_base(integer);
DROP FUNCTION comptaproc.card_class_base(p_f_id integer);
CREATE OR REPLACE FUNCTION comptaproc.card_class_base(p_f_id integer)
RETURNS fiche_def.fd_class_base%TYPE AS
$BODY$
declare
n_poste fiche_def.fd_class_base%type;
begin
select fd_class_base into n_poste from fiche_def join fiche using
(fd_id)
where f_id=p_f_id;
if not FOUND then
raise exception 'Invalid fiche card_class_base(%)',p_f_id;
end if;
return n_poste;
end;
$BODY$
LANGUAGE 'plpgsql' VOLATILE
COST 100;
ALTER FUNCTION comptaproc.card_class_base(integer) OWNER TO trunk;