Advertisement
Shailrshah

A Function Returning the Square of its Argument

Oct 26th, 2013
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 0.23 KB | None | 0 0
  1. CREATE OR REPLACE FUNCTION squareOf(input IN NUMBER) RETURN NUMBER IS
  2. BEGIN
  3. RETURN(input*input);
  4. END;
  5. /
  6. DECLARE
  7. x NUMBER(8,2) := &x;
  8. BEGIN
  9. DBMS_OUTPUT.put_line('The square of the number is ' || squareOf(x) || '.');
  10. END;
  11. /
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement