CREATE OR REPLACE FUNCTION VERIFICA_ALMOX(P_CDFILIAL      IN VARCHAR2,
                                          P_CDALMOXARIFE   IN VARCHAR2) RETURN VARCHAR IS

   V_CDALMOXARIFE   VARCHAR2(6);

BEGIN
   BEGIN
      SELECT CDALMOXARIFE
      INTO V_CDALMOXARIFE
      FROM ALMOXARIFADO
      WHERE CDFILIAL = P_CDFILIAL
        AND CDALMOXARIFE = P_CDALMOXARIFE;
   EXCEPTION
      WHEN NO_DATA_FOUND THEN
         V_CDALMOXARIFE := NULL;
   END;
   RETURN(V_CDALMOXARIFE);
END;
/
-- VERSAO --
BEGIN ATUVEROBJ('VERIFICA_ALMOX','5.09.001'); END;
/

