Create a program script that uses a PL/SQL anonymous block to perform the following:
Use a host variable AREA to store the result. Declare a local variable RADIUS with numeric data type. Declare a constant PI with value 3.14. Assign a value to the variable RADIUS by using a substitution variable. Calculate area of a circle by using formula
Then print result in SQL*Plus.
```
SQL> VARIABLE area NUMBER
SQL> DECLARE
2 radius NUMBER(2) := &s_radius;
3 pi CONSTANT NUMBER := 3.14;
4 BEGIN
5 :area := pi * radius * radius;
6 END;
7 /
Enter value for s_radius: 5
old 2: radius NUMBER(2) := &s_radius;
new 2: radius NUMBER(2) := 5;
PL/SQL procedure successfully completed.
SQL> PRINT area
AREA
----------
78.5
```
You might also like to view...
Pop-up windows can be disabled in most browser programs by turning on the Pop-up Blocker option from the Privacy tab of the ________ dialog box
Fill in the blank(s) with correct word
When multiple shapes are selected each shape has its own border with resizing handles
Indicate whether the statement is true or false