nerdexam
Oracle

1Z0-071 · Question #98

You need to display the date 11-oct-2007 in words as `Eleventh of October, Two Thousand Seven'. Which SQL statement would give the required result?

The correct answer is C. SELECT TO_CHAR (TO_DATE (`11-oct-2007'), `fmDdspth "of" month, Year') FROM DUAL. scott@TEST0924> SELECT TO_CHAR('11-oct-2007', 'fmDdspth "of" Month, Year') FROM SELECT TO_CHAR('11-oct-2007', 'fmDdspth "of" Month, Year') FROM DUAL ERROR at line 1: ORA-01722: invalid number scott@TEST0924> SELECT TO_CHAR(TO_DATE('11-oct-2007'), 'fmDdspth of month, year')…

Using Conversion Functions and Conditional Expressions

Question

You need to display the date 11-oct-2007 in words as `Eleventh of October, Two Thousand Seven'. Which SQL statement would give the required result?

Options

  • ASELECT TO_CHAR (TO_DATE ('11-oct-2007'), `fmDdthsp "of" Month, Year') FROM DUAL
  • BSELECT TO_CHAR (11-oct-2007', fmDdspth "of" Month, Year') FROM DUAL
  • CSELECT TO_CHAR (TO_DATE (11-oct-2007'), fmDdspth "of" month, Year') FROM DUAL
  • DSELECT TO_DATE (TO_CHAR ('11-oct-2007'), `fmDdspth "of" Month, Year')) FROM DUAL

How the community answered

(61 responses)
  • A
    7% (4)
  • B
    3% (2)
  • C
    77% (47)
  • D
    13% (8)

Explanation

scott@TEST0924> SELECT TO_CHAR('11-oct-2007', 'fmDdspth "of" Month, Year') FROM SELECT TO_CHAR('11-oct-2007', 'fmDdspth "of" Month, Year') FROM DUAL ERROR at line 1: ORA-01722: invalid number scott@TEST0924> SELECT TO_CHAR(TO_DATE('11-oct-2007'), 'fmDdspth of month, year') SELECT TO_CHAR(TO_DATE('11-oct-2007'), 'fmDdspth of month, year') FROM DUAL ERROR at line 1: ORA-01821: date format not recognized scott@TEST0924> SELECT TO_CHAR(TO_DATE('11-oct-2007'), 'fmDdthsp "of" Month, Year') TO_CHAR(TO_DATE('11-OCT-2007'),'FMDDTHS --------------------------------------- Eleventh of October, Two Thousand Seven scott@TEST0924> SELECT TO_DATE(TO_CHAR('11-oct-2007','fmDdspth ''of'' Month, Year')) SELECT TO_DATE(TO_CHAR('11-oct-2007','fmDdspth ''of'' Month, Year')) FROM DUAL ERROR at line 1: ORA-01722: invalid number ---------------------

Topics

#TO_CHAR#TO_DATE#date format model#spell out date

Community Discussion

No community discussion yet for this question.

Full 1Z0-071 Practice