/******************************************************* 
****   Funcao que retorna o primeiro dia do mes  *******
********************************************************

Criado em  : 11/2015
       Por : Jeferson E.
*/

CREATE OR REPLACE FUNCTION FIRST_DAY(PDATA DATE) RETURN DATE IS
  RESULT DATE;
BEGIN
  RESULT := LAST_DAY(ADD_MONTHS(PDATA, -1)) + 1;
  RETURN(RESULT);
END FIRST_DAY;

/
-- VERSAO --
BEGIN ATUVEROBJ('FIRST_DAY','5.85.xxx'); END;
/
