Here changed:
create table table1(c1 varchar2(1), c2 number);
insert into table1 values('R', 1);
insert into table1 values('B', 4);
insert into table1 values('Z', 3);
commit;
declare
type r1 is table of table1.c1%type index by binary_integer;
type r2 is table of table1.c2%type index by binary_integer;
l_c1 r1;
l_c2 r2;
begin
select c1, c2
bulk collect into l_c1, l_c2
from table1;
end;
/
Note: You cannot mix multiple rows(RECORD) with an PL/SQL table(index by
table)
Advice: Always use index by table collection, instead of Nested tables or
Varrays WHEN CODING with PL/SQL(strong constructs)
hth,
Regis
-----Original Message-----
From: Desu, Ramesh (CONS FIN, TCS Consultancy, CONSULTANT)
[mailto:Ramesh.[Email Address Removed] Thursday, October 31, 2002 11:21 AM
To: LazyDBA.com Discussion
Subject: bulk collect ..
Hi,
What is wrong with the following code ?
TIA
Rd
declare
type r1 is record (c1 varchar2(1), c2 number );
type t1 is table of r1 index by binary_integer;
tab1 t1 ;
begin
select c1,c2
bulk collect into tab1
from table1;
....
....
end;
--------
Oracle documentation is here:
http://tahiti.oracle.com/pls/tahiti/tahiti.homepage
To unsubscribe: send a blank email to oracledba-[Email Address Removed] subscribe: send a blank email to oracledba-[Email Address Removed] the list archive: http://www.LAZYDBA.com/odbareadmail.pl
Tell yer mates about http://www.farAwayJobs.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html
*********************************************************************
This electronic transmission is strictly confidential and intended solely
for the addressee. It may contain information which is covered by legal,
professional or other privilege. If you are not the intended addressee,
you must not disclose, copy or take any action in reliance of this
transmission. If you have received this transmission in error,
please notify the sender as soon as possible.
This footnote also confirms that this message has been swept
for computer viruses.
**********************************************************************
Oracle LazyDBA home page