-
Can anyone tell me how to execute a function within SQL PLus that returns a value.
Ex.
create or replace function FN_AREA( P_Radius in number)
return number as
Area Number := 0 ;
begin
Area := (22/7) * P_radius * P_radius ;
return Area ;
end;
/
Ed
-
SQL>declare
2 nn number;
3 begin
4 nn := getmyMoney('hello');
5 dbms_output.put_line(to_char(nn));
6 end;
-
Hey...Don't forget to
SQL> set serveroutput on
before executing the function.
You know that :-)
Good luck
-
Select FN_AREA(x) from dual;
where x is your P_Radius.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|