exam questions

Exam 1z0-144 All Questions

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

Exam 1z0-144 topic 1 question 64 discussion

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

Examine the following PL/SQL code:

Which statement is true about the fetch statements in the PL/SQL code?

  • A. Each fetch retrieves the first row and assigns values to the target variables.
  • B. Each fetch retrieves the next consecutive row and assigns values to the target variables.
  • C. They produce an error because you must close and reopen the cursor before each fetch -statement.
  • D. Only the first fetch retrieves the first row and assigns values to the target variables- the second produces an error.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

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
trex_fcs
1 year, 10 months ago
Selected Answer: B
declare cursor c1 is select last_name from employees order by hire_date; name1 employees.last_name%TYPE; name2 employees.last_name%TYPE; name3 employees.last_name%TYPE; BEGIN OPEN c1; FETCH c1 into name1; FETCH c1 into name2; FETCH c1 into name3; DBMS_OUTPUT.PUT_LINE(name1||' '||name2||' '||name3); CLOSE c1; END;
upvoted 1 times
...
sobrinho
4 years, 5 months ago
B is correct. SET SERVEROUTPUT ON; DECLARE CURSOR c1 IS SELECT last_name FROM employees ORDER BY last_name; name1 employees.last_name%TYPE; name2 employees.last_name%TYPE; name3 employees.last_name%TYPE; BEGIN OPEN c1; FETCH c1 INTO name1; FETCH c1 INTO name2; FETCH c1 INTO name3; CLOSE c1; dbms_output.put_line('name1: ' || name1); dbms_output.put_line('name2: ' || name2); dbms_output.put_line('name3: ' || name3); END; / name1: Abel name2: Ande name3: Atkinson PL/SQL procedure successfully completed.
upvoted 3 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