Which three lines of code must be added for it to successfully compile?

Examine the incomplete code:

Which three lines of code must be added for it to successfully compile?
A. curid := DBMS_SQL.TO_CURSOR_NUMBER (src_cur);
B. src_cur := DBMS_SQL.TO_REFCURSOR (curid);
C. src_cur= NUMBER;
D. curid NUMBER;
E. curid SYS_FEFCURSOR;
F. src_cur SYS_REFCURSOR;

Download Printable PDF. VALID exam to help you PASS.

4 thoughts on “Which three lines of code must be added for it to successfully compile?

  1. BDF

    create or replace procedure list_sal (dept_id number) is
    sql_stmt varchar2(200);
    ret integer;
    empids numlist;
    sal numlist;
    curid NUMBER; –D.
    src_cur SYS_REFCURSOR; — F
    begin

    curid := dbms_sql.open_cursor;
    sql_stmt := ‘select employee_id, salary from employees where department_id = :id’;
    dbms_sql.parse(curid, sql_stmt, dbms_sql.native);
    dbms_sql.bind_variable(curid, ‘id’, ‘dept_id’);
    ret := dbms_sql.execute(curid);
    src_cur := DBMS_SQL.TO_REFCURSOR (curid);
    fetch src_cur bulk collect into empids, sal;
    if empids.count > 0 then
    for i in 1..empids.count loop
    dbms_output.put_line(empids(i) || ‘ ‘ || sal(i));
    end loop;
    end if;
    close src_cur;
    end;

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.