I’ve tried the following code for printing each or some detail based on the value I get from the cursor but I can’t, can anybody help me?
set serveroutput on
declare
d_id number;
temp_tab VARRAY;
cursor c1 is select * from(select d.department_ID, `enter code here`d.department_name,count(d.department_name) cnt from employees e,departments d where e.department_id=d.department_id group by d.department_ID, d.department_name) where cnt>=5;
begin
open c1;
for i in c1
loop
select e.first_name,d.department_id,d.department_name into temp_tab from employees e,departments d where d.department_id=i.department_ID;
end loop;
close c1;
end;
Yes.If you want to print ant element value.Then select the element value into the variable.
Then use below one to print the element value :
In your code you are using the collection varaiable and fetching value into collection.
Then to print objects elements:
If you are using the record variable in PLSQL.Then use the below method:then declare the record type variable then fetch into that variable then display variable.column,