The STUDENTS table exists in your schema.
Examine the DECLARE section of a PL/SQL block:
Which two blocks are valid?
A. BEGIN
OPEN cursor3 FOR SELECT * FROM students; cursor1 :=cursor3;
END;
B. BEGIN
OPEN stcur; cursor1 :=stcur;
END;
C. BEGIN
OPEN cursor1 FOR SELECT * FROM students; stcur :=cursor1;
END;
D. BEGIN
OPEN stcur; cursor3 :=stcur;
END;
E. BEGIN
OPEN cursor1 FOR SELECT * FROM students; cursor2 :=cursor1;
END;
declare
—
type studentcur_t is ref cursor return emp3%ROWTYPE;
type teachercur_t is ref cursor;
cursor1 studentcur_t;
cursor2 teachercur_t;
cursor3 sys_refcursor;
—
cursor stcur is
select * from emp3;
—
begin
— E
open cursor1 for select * from emp3;
cursor2 := cursor1;
— D
open stcur;
–cursor3 := stcur; not working
— C
open cursor1 for select * from emp3;
–stcur := cursor1; –not working
— B
if stcur%isopen then
close stcur;
end if;
open stcur;
–cursor1 := stcur; –not working
— A
open cursor3 for select * from emp3;
cursor1 := cursor3;
—
end;
AE
declare
type studentcur_t is ref cursor return students%ROWTYPE;
type teachercur_t is ref cursor;
cursor1 studentcur_t;
cursor2 teachercur_t;
cursor3 sys_refcursor;
cursor stcur is select * from students;
A, E are correct
https://dbfiddle.uk/?rdbms=oracle_11.2&fiddle=ed92066ffead0412d455fe9eb782399e
— ==============
A. Successfully
B. PLS-00382: expression is of wrong type
C. PLS-00321: expression ‘STCUR’ is inappropriate as the left hand side of an assignment statement
D. PLS-00382: expression is of wrong type
E. valid