Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Need help with PL/SQL's bulk collect.
In article <3C961657.DA3B021_at_lucent.com>, Duncan says...
>
>Hi,
>
>I need help with using bulk collect in PL/SQL. The code I'm using is:
>
>DECLARE
> TYPE EmpnoTab IS TABLE OF emp.empno%TYPE;
> emp_nos EmpnoTab;
>BEGIN
> SELECT empno BULK COLLECT INTO emp_nos
> FROM emp;
>END;
>
>
>But I get:
>
>
> SELECT empno BULK COLLECT INTO emp_nos
> *
>ERROR at line 5:
>ORA-06550: line 5, column 23:
>PLS-00103: Encountered the symbol "COLLECT" when expecting one of the
>following:
>, from into
>The symbol "," was substituted for "COLLECT" to continue.
>
>
>
>I can't see why this shouldn't work. Any ideas anyone?
>
>Thanks in advance,
>Duncan
scott_at_ORA817DEV.US.ORACLE.COM> DECLARE
2 TYPE EmpnoTab IS TABLE OF emp.empno%TYPE; 3 emp_nos EmpnoTab; 4 BEGIN 5 SELECT empno BULK COLLECT INTO emp_nos 6 FROM emp;
PL/SQL procedure successfully completed.
scott_at_ORA806.WORLD> DECLARE
2 TYPE EmpnoTab IS TABLE OF emp.empno%TYPE; 3 emp_nos EmpnoTab; 4 BEGIN 5 SELECT empno BULK COLLECT INTO emp_nos 6 FROM emp;
*
you have been reading the Oracle8i plsql guide but programming in Oracle8.0
Bulk collect is a new 8i feature (new being a relative term here as 815 is pretty old now)
-- Thomas Kyte (tkyte@us.oracle.com) http://asktom.oracle.com/ Expert one on one Oracle, programming techniques and solutions for Oracle. http://www.amazon.com/exec/obidos/ASIN/1861004826/ Opinions are mine and do not necessarily reflect those of Oracle CorpReceived on Mon Mar 18 2002 - 20:42:07 CST
![]() |
![]() |