Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
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 (?) , you can switch to a simple comment.
Switch to a voting comment New
Bissto
2 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
1 month, 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
9 months, 4 weeks ago
Selected Answer: D
D works -> implicit conversion!
upvoted 2 times
...
lucemqy
1 year ago
Selected Answer: D
D tried it and worked
upvoted 1 times
...
Rik92
1 year, 7 months ago
Selected Answer: D
D, implicit conversion works
upvoted 2 times
...
Orakol
1 year, 8 months ago
Selected Answer: D
Correct answer is D - it executes successfully, my result: 27-02
upvoted 3 times
...
jfc1
1 year, 8 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 ...