Advertisement
Guest User

Untitled

a guest
May 6th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. SELECT TO_CHAR(pDate, 'Mon dd, yyyy', 'NLS_DATE_LANGUAGE = American') FROM DUAL;
  2. SELECT TO_CHAR(pDate, 'Mon dd, yyyy', 'NLS_DATE_LANGUAGE = English') FROM DUAL;
  3.  
  4. CREATE FUNCTION to_char_abbr_month(
  5. in_date DATE,
  6. in_nls VARCHAR2
  7. ) RETURN VARCHAR2 DETERMINISTIC
  8. IS
  9. BEGIN
  10. RETURN REGEXP_REPLACE(
  11. TRIM( TO_CHAR( in_date, 'Month', in_nls ) ),
  12. '(w{3})w{2,}',
  13. '1.'
  14. )
  15. || ' ' || TO_CHAR( in_date, 'dd, yyyy', in_nls );
  16. END;
  17. /
  18.  
  19. SELECT to_char_abbr_month(
  20. DATE '2016-01-01',
  21. 'NLS_DATE_LANGUAGE = American'
  22. )
  23. FROM DUAL
  24.  
  25. Jan. 01, 2016
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement