Sum of N Numbers in PL/SQL
758839Mar 9 2010 — edited Jul 24 2011Hi,
I need to get the Sum of N different numbers using PL/ SQL.
I have written the code like this
Declare
Sum Number := 0;
Begin
For I in 1 .. 5
Loop
Sum := Sum + &Num;
End Loop;
Dbms_Output.Put_Line('Sum = ' || Sum);
End;
/
But once only its accepting the value for Num.
Can I get any solution for this?
With Regards,
Prakash D
Edited by: user12773448 on Mar 9, 2010 3:12 AM
Edited by: Prakash D on Mar 9, 2010 3:13 AM