Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

How to run procedure To compile the proc, then run compile with procedure name and options.

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>)

How to run package Execute package_name.procedure_name(:io_cursor);

How to run function

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

You might also like