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!

Area of circle

733913Nov 12 2009 — edited Nov 12 2009
Following code as mentioned below is not working properly( while loop is functional as it should be)......Please suggest solution for this..

1* SELECT * FROM AREA
SQL>
SQL> DECLARE
2 R NUMBER(5,2);
3 AR NUMBER(8,2);
4 Pi CONSTANT NUMBER(3,2):=(22/7);
5 CH VARCHAR2(1);
6 BEGIN
7 CH:='Y';
8 WHILE(CH='Y')
9 LOOP
10 R:=&R;
11 AR:=POWER(R,2)*Pi;
12 INSERT INTO AREA VALUES(R,AR);
13 CH:='&CH';
14 END LOOP;
15 END;/
16 /
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 10 2009
Added on Nov 12 2009
2 comments
502 views