If you have already worked in BIP reports ,getting the name of the day from SQL query might seem not feasible.
Lets say if we run below query, it is always going to return a number denoting the day.
==> select to_char( SYSDATE , 'DAY' ) Todays_name from dual; -- considering today is friday
Todays_name
==========
6
However if you want the result to be either FRIDAY or Saturday, then we need to pass an additional parameter to the TO_CHAR() function. This is 'nls_date_language = American'.
===> select to_char(sysdate, 'DAY' , 'nls_date_language = American' ) Todays_name from dual;
Todays_name
==========
FRIDAY
For more info on this please refer to official Oracle documentation.
===> https://docs.oracle.com/cd/B13789_01/server.101/b10749/ch9sql.htm
Hope this helps.
Thanks,
Srikanth
No comments:
Post a Comment