Call oracle stored procedures and functions -- create or replace procedure pro_add (num1 number, num2 number, r out number) asbeginr: = num1 + num2; end; www.2cto.com create or replace procedure pro_minus (num1 number, num2 number, r out number) asbeginr: = num1-num2; end; -- create function create or replace function fcn_add (num1 number, num2 number) return number is r number; beginr: = num1 + num2; return r; end; create or replace function fcn_minus (num1 number, num2 number) return number isbeginreturn num1-num2; end; www.2cto.com create or replace function fcn_minus1 (num1 number, num2 number) return number isr number; r1 number; begin r: = num1-num2; r1: = num2-num1; if r-r1> 0 thenreturn r; elsereturn r1; end if; end; -- call the Stored Procedure declaren1 number; n2 number; r number; fr number; beginn1: = 3; n2: = 2; pro_add (n1, n2, r); dbms_output.put_line ('add result: '| r); -- 1 You can use this method to obtain the returned value of the stored procedure pro_minus (n1, n2, r ); -- 2 You can also use this method to obtain the returned values of stored procedures: pro_minus (num1 => n1, num2 => n2, r => r ); -- If 1 is used, all parameters need to be passed in this way -- if 2 is used, all parameters need to be written in the same way -- the second method is used. the result of the correlation dbms_output.put_line ('subtraction: '| r); end; www.2cto.com -- call functiondeclaren1 number; n2 number; r number; begin www.2cto.com -- to obtain the return value of a function, you only need to call it in the normal way. n1: = 3; n2: = 5; r: = fcn_add (num1 => n1, num2 => n2); dbms_output.put_line ('add result: '| r); r: = fcn_minus (num1 => n1, num2 => n2); dbms_output.put_line ('result of using fcn_minus subtraction: '| r); r: = fcn_minus1 (num1 => n1, num2 => n2 ); dbms_output.put_line ('result of using fcn_minus1 subtraction: '| r); end; Author: tengdazhang770960436