Function to convert celsius to fahrenheit : Function Definition « Stored Procedure Function « Oracle PL / SQL






Function to convert celsius to fahrenheit

   

SQL> CREATE OR REPLACE FUNCTION celsius_to_fahrenheit (degree NUMBER) RETURN NUM
BER IS
  2      buffer NUMBER;
  3  BEGIN
  4     buffer := (degree * 9/5) + 32;
  5     RETURN buffer;
  6  END celsius_to_fahrenheit;
  7  /

Function created.

SQL>
SQL>

   
    
    
  








Related examples in the same category

1.Define and call a function
2.Define and use function in select clause
3.A stored function.
4.Use user-defined function in if statement
5.Recursive function
6.function with no return type
7.Recursive function Factorial
8.A local function
9.Recursive function 2
10.demonstrates the behavior of the DETERMINISTIC keyword.
11.Function to convert fahrenheit to celsius
12.A function is executed like any other SQL built-in function:
13.Count Employee from a function and return value back
14.How stored functions can be called from SQL
15.Raise exception from inner function