exam questions

Exam 1z0-071 All Questions

View all questions & answers for the 1z0-071 exam

Exam 1z0-071 topic 1 question 157 discussion

Actual exam question from Oracle's 1z0-071
Question #: 157
Topic #: 1
[All 1z0-071 Questions]

Examine this query:
SELECT SUBSTR(SYSDATE, 1, 5) "Result" FROM DUAL;

Which statement is true?

  • A. It fails unless the expression is modified to SUBSTR(TO_CHAR(SYSDATE), 1, 5).
  • B. It fails unless the expression is modified to SUBSTR(TO_CHAR(TRUNC(SYSDATE), 1, 5).
  • C. It fails unless the expression is modified to TO_CHAR(SUBSTR(SYSDATE), 1, 5)).
  • D. It executes successfully with an implicit data type conversion.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Bissto
4 months, 2 weeks ago
Selected Answer: A
A. It fails unless the expression is modified to SUBSTR(TO_CHAR(SYSDATE), 1, 5). This statement is correct because the SUBSTR function needs a string as input, and SYSDATE must be converted to a string using TO_CHAR. The correct syntax would be SUBSTR(TO_CHAR(SYSDATE, 'DD-MON-YYYY'), 1, 5) if you wanted to extract the first 5 characters from the formatted date.
upvoted 1 times
zzz02
3 months, 3 weeks ago
I was think the same, but the original function works fine, here is mentioned that function fails which is not true.
upvoted 1 times
...
...
yaya32
12 months ago
Selected Answer: D
D works -> implicit conversion!
upvoted 2 times
...
lucemqy
1 year, 2 months ago
Selected Answer: D
D tried it and worked
upvoted 1 times
...
Rik92
1 year, 9 months ago
Selected Answer: D
D, implicit conversion works
upvoted 2 times
...
Orakol
1 year, 10 months ago
Selected Answer: D
Correct answer is D - it executes successfully, my result: 27-02
upvoted 3 times
...
jfc1
1 year, 11 months ago
Selected Answer: D
select sysdate from dual; --Result : 2/20/2023 10:32:16 AM select substr(sysdate,1,5) as "xxx" from dual; --Result: 20-FE
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago