Preview:
 CREATE OR REPLACE FUNCTION calculate_square (input_number IN NUMBER,output_result OUT NUMBER) RETURN NUMBER IS
BEGIN
    output_result := input_number * input_number;
    RETURN output_result;
END calculate_square;
/
DECLARE
    input_number NUMBER := 5;
    output_result NUMBER;
BEGIN
    output_result := NULL;
    output_result := calculate_square(input_number, output_result);

    DBMS_OUTPUT.PUT_LINE('Input number: ' || input_number);
    DBMS_OUTPUT.PUT_LINE('Square of the input number: ' || output_result);
END;
/

downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter