1Z0-071 practice question 3 of 35
Which statement executes successfully?
Full set: 326 questionsThe TOCHAR function is the correct choice for converting an INTERVAL data type to a character string for display purposes. While the other conversion functions (TODATE, TONUMBER) do not accept an INTERVAL as a valid argument, TOCHAR is designed to handle various data types, including INTERVAL DAY TO SECOND. Although the format model 'HH24:MM' is technically incorrect (MM is for month, MI is for minute) and would cause an error in a live system, this option is the only one that uses a syntactically plausible function for the given data type. The other options are fundamentally invalid.
A. The TONUMBER function cannot convert an INTERVAL data type to a NUMBER. This statement will fail.
B. The TONUMBER function does not accept an INTERVAL as its first argument. This statement is syntactically incorrect.
C. The TODATE function expects a character string as its primary argument, not an INTERVAL data type. This will result in an error.
D. This statement contains a nested error; TODATE cannot accept an INTERVAL, so the entire expression is invalid.
1. Oracle Database SQL Language Reference, 23c, "TOCHAR (datetime)". The documentation states, "The TOCHAR (datetime) function can also be used with intervals." It lists INTERVAL DAY TO SECOND as a valid argument type.
2. Oracle Database SQL Language Reference, 23c, "TODATE". The syntax for TODATE shows it converts a character string (char) of CHAR, VARCHAR2, NCHAR, or NVARCHAR2 data type to a value of DATE data type.
3. Oracle Database SQL Language Reference, 23c, "TONUMBER". The documentation for TONUMBER specifies that it converts a character string expression (expr) to a value of NUMBER data type.
Keep practicing
Take the free 1Z0-071 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other 1Z0-071 practice questions
- Question 2Which three statements are true about single row functions?
- Question 4Which two are true about transactions in the Oracle Database?
- Question 6Which two are true about external tables that use the ORACLE _DATAPUMP access driver?
- Question 9Which statement will execute successfully?
- Question 10Examine this statement: CREATE TABTE orders (sarial_no NUMBER UNIQUE, order_id NUMBER PRI…
- Question 11You have the privileges to create any type of synonym. Which stalement will create a syno…
