Professional Documents
Culture Documents
How To Execure Package
How To Execure Package
To run the procedure by running exec procedure command with passing variables. systax for compilation ALTER PROCEDURE [ schema. ]procedure COMPILE [ compiler_parameters_clause [ compiler_parameters_clause ] ... ] [ REUSE SETTINGS ] ; e.g. Alter Procedure scott.sample Compile ; To run procedure example, Exec Sample; Or Exce sample(<variable_names>)
Creating a Function: Examples The following statement creates the function get_bal on the sample table oe.orders (the PL/SQL is in italics):
CREATE FUNCTION get_bal(acc_no IN NUMBER) RETURN NUMBER IS acc_bal NUMBER(11,2); BEGIN SELECT order_total INTO acc_bal FROM orders WHERE customer_id = acc_no; RETURN(acc_bal); END; / SELECT get_bal(165) FROM DUAL; GET_BAL(165) -----------2519