hi - I need help with while santence [message #339965] |
Sun, 10 August 2008 08:17 |
levindi
Messages: 6 Registered: August 2008
|
Junior Member |
|
|
I tried this code:
DECLARE
x NUMBER ( 2 ) := 1;
BEGIN
WHILE x <> 10 LOOP
x:=&enter_x;
[here I want to enter any procedure]
END LOOP;
END;
I want the user will enter every time a number and if the number is different from 10 the procedure will start.
this code stuck my sqldeveloper.
Thanks for the help,
|
|
|
|
Re: hi - I need help with while santence [message #339967 is a reply to message #339965] |
Sun, 10 August 2008 08:45 |
levindi
Messages: 6 Registered: August 2008
|
Junior Member |
|
|
thank you,
I tried to trick it by this:
begin
while i<x LOOP
i:=i+1;
v_item :=&enter_which_item_to_order;
v_quantity :=&enter_how_much_do_you_want;
insert_orders_details(v_item=>v_item,
v_quantity=>v_quantity);
end loop;
end;
also with for..loop, it asked me just once for number:
v_p:=&how_much_diff_items_you_want?;
for i in 1..v_p LOOP
v_item := &enter_which_item_to_order;
v_quantity := &enter_how_much_do_you_want;
insert_orders_details(v_item=>v_item, v_quantity=>v_quantity);
end loop;
end;
help? thanks
[Updated on: Sun, 10 August 2008 09:02] Report message to a moderator
|
|
|
|
Re: hi - I need help with while santence [message #339969 is a reply to message #339967] |
Sun, 10 August 2008 09:26 |
|
Michel Cadot
Messages: 68728 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
What you have to understand is the difference between what is done on client and what is done on server.
conversion &x -> its value is done in client.
Once ALL the "&" variables are substitute by their values then the block is sent ONCE AND ONLY ONCE to the server where it is executed.
So you can't ask several times a value: there is no back and forth between client and server.
Regards
Michel
[Updated on: Sun, 10 August 2008 09:26] Report message to a moderator
|
|
|
|