Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Question
A copy of this was sent to Steven <koh_cc_at_pacific.net.sg>
(if that email address didn't require changing)
On Tue, 15 Dec 1998 18:35:14 -0800, you wrote:
>hi,
>
> Can we use arrays to store values in PL/SQL ?
>
> Any online tutorial for this ?
You can use pl/sql table types as arrays. For example:
create or replace procedure foo
as
type myArray is table of number index by binary_integer;
x myArray;
begin
for i in 1 .. 10 loop
x(i) := i;
end loop;
for i in 1 .. x.count loop
dbms_output.put_line( x.(i) );
end loop;
end;
the pl/sql docs talk about table types and all of the attributes (.count, .delete, .exists, .first, .next and so on)
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Service Industries
Reston, VA USA
--
http://govt.us.oracle.com/ -- downloadable utilities
Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Tue Dec 15 1998 - 06:04:15 CST
![]() |
![]() |