Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Need to Print a Number or character in a Seqeunence mentioned below

534749Jul 28 2008 — edited Jul 28 2008
Hi all ,
I am tryting to write a function which will have print ( Number 0r Character)
as


1
2 2
3 3 3
4 4 4 4
5 5 5 5 5

in this sequence
then

aaa
bbb bbb
ccc ccc ccc
dddd dddd dddd dddd
ggggg ggggg ggggg ggggg ggggg

I tried this but know i am just a Beginner here

CREATE OR REPLACE FUNCTION test_numberarray
(numberarr in number ) RETURN NUMBER is
val number := 0 ;
val1 NUMBER := 0;

BEGIN
for i in 1 .. numberarr loop
val1 := i + val1;
val := Val1;
dbms_output.put_line('The number array is :- '|| val1 ||' '|| val);
END loop;

Return val1;

End;

Can any body pls point me out how should i correct it.
What should i take care henceforth tno to make any such mistakes like this.

Thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 25 2008
Added on Jul 28 2008
3 comments
2,013 views