Thursday, May 5, 2016

SQL to fetch first day and last day of the month

SELECT LEVEL,
       TO_CHAR (TRUNC (ADD_MONTHS (SYSDATE, LEVEL - 1), 'MM'), 'DD-MON-RRRR'),
       TO_CHAR (LAST_DAY (ADD_MONTHS (SYSDATE, LEVEL - 1)), 'DD-MON-RRRR')
FROM DUAL
CONNECT BY LEVEL <= 100;

How to open wrapped Package Source Code in Oracle Apps

http://www.codecrete.net/UnwrapIt/

How to fetch current login user using sql

select SYS_CONTEXT('USERENV', 'SESSION_USER') from dual;