How to refresh variable in loop [message #269921] |
Tue, 25 September 2007 02:22 |
vit_Rakesh@yahoo.co.in
Messages: 1 Registered: September 2007
|
Junior Member |
|
|
hi,
can any one tell me that how to refresh variable r inside the loop so that it can ask for the value of variable r in each iteration. In this case only first time it is asking to enter value for r and in further iteration it is using same value of r.
declare
pi constant number := 3.14;
r number;
i number;
ar number(12,2);
begin
i := 1;
while i <= 3
loop
r := &radius;
ar := pi * power(r,2);
insert into areatab1 values(r,ar);
i := i + 1;
end loop;
end;
|
|
|
Re: How to refresh variable in loop [message #269922 is a reply to message #269921] |
Tue, 25 September 2007 02:25 |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
You can not.
You are asked for a value of r once, when sqlplus interprets the block prior to sending it to the server.
Then it is execute as an atomic block on the server, without (possibility to) interact during the run.
|
|
|