ASCIISTR, HEXTORAW and RAWTOHEX
SELECT
 ASCIISTR(ref_str) ascii_str,
 RAWTOHEX(ref_str) raw_to_hex,
 UTL_RAW.CAST_TO_VARCHAR2(RAWTOHEX(ref_str)) cast_2_varchar2, 
 UTL_RAW.CAST_TO_VARCHAR2(HEXTORAW(RAWTOHEX(ref_str)))  hex_2_raw 
FROM
 (SELECT 'Hello World' ref_str FROM DUAL);
 
DATE Functions
-- Get Monday dates

SELECT
 TO_CHAR(ref_date,'mm/dd/yyyy') ref_date,
 NEXT_DAY(ADD_MONTHS(TRUNC(ref_date,'MON'),-1),'MON') prev_1st_Monday,
 NEXT_DAY(TRUNC(ref_date,'MON'),'MON') curr_1st_Monday,
 DECODE(TO_CHAR(LAST_DAY(TRUNC(ref_date,'MON')),'DY'),
  'MON',LAST_DAY(TRUNC(ref_date,'MON')),
  'TUE',LAST_DAY(TRUNC(ref_date,'MON'))-1,
  'WED',LAST_DAY(TRUNC(ref_date,'MON'))-2,
  'THU',LAST_DAY(TRUNC(ref_date,'MON'))-3,
  'FRI',LAST_DAY(TRUNC(ref_date,'MON'))-4,
  'SAT',LAST_DAY(TRUNC(ref_date,'MON'))-5,
  'SUN',LAST_DAY(TRUNC(ref_date,'MON'))-6
  ) last_monday
FROM 
 (SELECT TO_DATE(&yyyymmdd,'yyyymmdd') ref_date FROM DUAL);

Functions and Dual Table

Oracle registered trademark of Oracle Corporation.

Last Revised On: June 26th, 2014

  398