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;
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
...
Log in to ExamTopics
Sign in:
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.
trex_fcs
1 year, 10 months agosobrinho
4 years, 5 months ago