CREATE OR REPLACE PROCEDURE NMUSUARIO (P_NMUSUARIO OUT VARCHAR2) IS
   V_CLIENT_INFO  VARCHAR2(64);
   V_CDOPERADOR   OPERADOR.CDOPERADOR%TYPE;
BEGIN
   P_NMUSUARIO := NULL;

   DBMS_APPLICATION_INFO.READ_CLIENT_INFO(V_CLIENT_INFO);
   V_CDOPERADOR := SUBSTR(V_CLIENT_INFO,1,12);

   BEGIN
      SELECT NVL(NMOPERADOR, 'XXXXXX')
      INTO P_NMUSUARIO
      FROM OPERADOR
      WHERE CDOPERADOR = V_CDOPERADOR;
   EXCEPTION
      WHEN NO_DATA_FOUND THEN
         P_NMUSUARIO := 'VIA BD';
   END;
END;
/