SQL>
SQL> create or replace function getArea (i_rad NUMBER)
2 return NUMBER is
3 begin
4 return 3.14*(i_rad**2);
5 end;
6 /
Function created.
SQL>
SQL> declare
2 v_out NUMBER;
3 v_in1 CONSTANT NUMBER :=5;
4 v_in2 NUMBER :=4;
5
6 begin
7 v_out:=getArea(10); -- literal
8 v_out:=getArea(v_in1); -- constant
9 v_out:=getArea(v_in1); -- variable
10 v_out:=getArea(2+3); -- expression
11 v_out:=getArea(abs(2/3)); -- another function
12 end;
13 /
PL/SQL procedure successfully completed.
SQL>
SQL>
|