Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: PlL/SQL and Array Question
A copy of this was sent to "Peter H. Larsen" <plarsen_at_dc.dynares.com>
(if that email address didn't require changing)
On Thu, 11 Jun 1998 13:00:10 -0400, you wrote:
>Hi,
>If you look back in the thread, you'll see that the problem resides on an Oracle7 and NOT
>Oracle8.
>Correct me if I'm wrong, but the first and last attributes of arrays is NOT available in
>Oracle7 .... Right?
>
the first, last, count, etc attributes were added in 7.3.
$ sqlplus tkyte/tkyte
SQL*Plus: Release 3.3.3.0.0 - Production on Thu Jun 11 13:37:24 1998 Copyright (c) Oracle Corporation 1979, 1996. All rights reserved.
Connected to:
Oracle7 Server Release 7.3.3.0.0 - Production Release
With the distributed, replication, parallel query and Spatial Data options
PL/SQL Release 2.3.3.0.0 - Production
SQL> set echo on SQL> @test SQL> create or replace package types 2 as 3 type vcArray is table of varchar2(255) index by binary_integer;4 end;
SQL>
SQL> create table test_msg( seq number, msg varchar2(72) );
Table created.
SQL>
SQL> create or replace procedure show_array( p_array in types.vcArray )
2 as
3 l_index number; 4 l_cnt number default 0; 5 begin 6 for i in 1 .. p_array.count loop 7 insert into test_msg values ( l_cnt, p_array(i) ); 8 l_cnt := l_cnt+1; 9 end loop; 10 10 insert into test_msg values ( l_cnt, '------------------' ); 11 l_cnt := l_cnt+1; 12 12 l_index := p_array.first; 13 loop 14 exit when (l_index is NULL); 15 insert into test_msg values ( l_cnt, p_array(l_index) ); 16 l_cnt := l_cnt+1; 17 l_index := p_array.next( l_index ); 18 end loop;
>- Peter H. Larsen
> Oracle Consultant
>
>
>
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA
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 Thu Jun 11 1998 - 12:56:58 CDT
![]() |
![]() |