Hello All,
I need help with the following problem:
Create a VARRAY with a size_limit of 15; initialize the VARRAY to 5 elements starting with 1. Using the DBMS_OUTPUT.PUT_LINE statement:
1. Show output using the collection method COUNT
2. Show output using the collection method FIRST
3. Show output using the collection method NEXT
4. Show output using the collection method LAST
5. Show output using the collection method LIMIT
How would I go about creating this?
THANKS for any replies.
PL/SQLCreate a Varray
Page 1 of 1
3 Replies - 2182 Views - Last Post: 21 November 2006 - 01:23 AM
Replies To: PL/SQL
#2
Re: PL/SQL
Posted 16 November 2006 - 04:33 AM
Why would we do your homework for you?
This post has been edited by Trogdor: 16 November 2006 - 04:35 AM
#3
Re: PL/SQL
Posted 16 November 2006 - 12:20 PM
#4
Re: PL/SQL
Posted 21 November 2006 - 01:23 AM
hi
this is kiran here.
for u r varray assignment this example will help u
-------------------------------------------------------------------------------------
Varray---
-----------------------------------------------------------------------------
create or replace procedure varray_test
as
type type_array is varray(5) of varchar2(50);
x type_array ;
cnt number :=0;
begin
x :=type_array();
for i in 1 .. x.limit
loop
cnt :=cnt +1;
x.extend;
dbms_output.put_line(x.count);
if (cnt mod 2 =0) then
x(i) := 'nivas + '||cnt;
end if;
end loop;
dbms_output.put_line(x.count);
for i in 1 .. x.count
loop
dbms_output.put_line(nvl(x(i),'kiran'));
end loop;
end;
now u can try it !!!!
bye
this is kiran here.
for u r varray assignment this example will help u
-------------------------------------------------------------------------------------
Varray---
-----------------------------------------------------------------------------
create or replace procedure varray_test
as
type type_array is varray(5) of varchar2(50);
x type_array ;
cnt number :=0;
begin
x :=type_array();
for i in 1 .. x.limit
loop
cnt :=cnt +1;
x.extend;
dbms_output.put_line(x.count);
if (cnt mod 2 =0) then
x(i) := 'nivas + '||cnt;
end if;
end loop;
dbms_output.put_line(x.count);
for i in 1 .. x.count
loop
dbms_output.put_line(nvl(x(i),'kiran'));
end loop;
end;
now u can try it !!!!
bye
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|