Fix bug in function card_class_base

This commit is contained in:
sparkyx 2006-08-08 20:51:45 +00:00
parent 53bc4dabea
commit adfcbf717b
2 changed files with 31 additions and 0 deletions

View file

@ -467,6 +467,9 @@ if ( DEBUG=='false' ) ob_start();
ExecuteScript($db,'sql/patch/upgrade15.sql');
} // version
if ( GetVersion($db) == 16 ) {
ExecuteScript($db,'sql/patch/upgrade16.sql');
} // version
if ( DEBUG == 'false') ob_end_clean();
}//for
@ -547,6 +550,9 @@ if (DEBUG == 'false' ) ob_start();
if ( GetVersion($db) == 15 ) {
ExecuteScript($db,'sql/patch/upgrade15.sql');
} // version
if ( GetVersion($db) == 16 ) {
ExecuteScript($db,'sql/patch/upgrade16.sql');
} // version
if ( DEBUG == 'false') ob_end_clean();
}

View file

@ -0,0 +1,25 @@
begin;
create or replace function card_class_base(p_f_id fiche.f_id%type)
returns fiche_def.fd_class_base%type
as
$$
declare
n_poste fiche_def.fd_class_base%type;
begin
-- card_class_base (integer)
-- param: $1 fiche.f_id
-- purpose : retrieve the class of a card
--
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;
$$ language plpgsql;
update version set val=17;
commit;