Sunday, January 3, 2016

Execute Immediate with select Statement



declare
    type tmp_tbm is table of emp.ename%type;
    emp_tbl tmp_tbm;
    begin
    execute immediate 'SELECT ename FROM EMP'
    bulk collect INTO emp_tbl;
    for i in 1..emp_tbl.COUNT loop
    dbms_output.put_line(emp_tbl(i));
    end loop;
   end;


No comments:

Post a Comment