CREATE OR REPLACE FUNCTION VERIFICA_LOCAL(P_CDFILIAL       IN VARCHAR2,
                                          P_CDALMOXARIFE   IN VARCHAR2,
                                          P_CDLOCALESTOQ   IN VARCHAR2) RETURN VARCHAR IS
   V_CDLOCALESTOQ   VARCHAR2(6);
BEGIN
   BEGIN
      SELECT CDLOCALESTOQ
      INTO V_CDLOCALESTOQ
      FROM LOCALESTOQUE
      WHERE CDFILIAL = P_CDFILIAL
        AND CDALMOXARIFE = P_CDALMOXARIFE
        AND CDLOCALESTOQ = P_CDLOCALESTOQ;
   EXCEPTION
      WHEN NO_DATA_FOUND THEN
         V_CDLOCALESTOQ := NULL;
   END;
   RETURN(V_CDLOCALESTOQ);
END;
/
-- VERSAO --
BEGIN ATUVEROBJ('VERIFICA_LOCAL','5.09.001'); END;
/
