Which statement will return the last sequence number generated by the EMP_ SEQ sequence?
A.
SELECT NEXTVAL FROM emp_ seq;
B.
SELECT CURRVAL FROM emp_ seq;
C.
SELECT emp_ seq. CURRVAL FROM DUAL;
D.
SELECT emp_ seq . NEXTVAL FROM DUAL;
The Answer Is:
B
This question includes an explanation.
Explanation:
A: NEXTVAL is used to increment the sequence and return the next value; it does not give the last number generated.
B: CURRVAL returns the current value of the sequence, which is the last value generated in the user's current session. However, CURRVAL cannot be queried unless NEXTVAL has been called at least once in that session.
C: CURRVAL is used correctly, but the syntax 'sequence.CURRVAL' is not correct in Oracle SQL.
D: NEXTVAL is used to generate the next sequence number, not to retrieve the last one generated.
1z0-071 PDF/Engine
Printable Format
Value of Money
100% Pass Assurance
Verified Answers
Researched by Industry Experts
Based on Real Exams Scenarios
100% Real Questions
Get 60% Discount on All Products,
Use Coupon: "8w52ceb345"