Bulk collect - how to get the output [message #286332] |
Fri, 07 December 2007 03:20 |
sudharshan
Messages: 48 Registered: November 2006
|
Member |
|
|
DECLARE
TYPE dept_coll IS TABLE OF dept%ROWTYPE;
dept_list dept_coll;
BEGIN
SELECT *
BULK COLLECT INTO dept_list
FROM dept;
dbms_output.put_line('the value is '||dept_list.deptno);
END;
1.it is throwing an error? how to loop through and get the records?
2.what is the advantage over cursor?
regards
sudharshan
|
|
|
|
|
Re: Bulk collect - how to get the output [message #286349 is a reply to message #286332] |
Fri, 07 December 2007 03:34 |
sudharshan
Messages: 48 Registered: November 2006
|
Member |
|
|
i get this error
ERROR at line 12:
ORA-06550: line 12, column 49:
PLS-00302: component 'DEPTNO' must be declared
ORA-06550: line 12, column 1:
PL/SQL: Statement ignored
when i change the statement
dbms_output.put_line('the value is '||dept_list(dept_list.first).deptno);
i get the answer but how to get all the columns say dname,loc.
|
|
|
|
|