Oracle Database Programming: Develop PL/SQL subprograms and packages to develop PL/SQL subprograms and packages: subprograms: Compile rather than run at run time. Only calls can produce results. Subprograms are divided into store procedure and function, which are stored in the database directly and in the database. DML addition, deletion, and switching processes, computing functions. Process: no return value.
create or replace procedure sp_test1 (p_num number, p_num1 out number, p_num2 in out number) is
Function: there is only one return value. The data type must be supported by the data table.
create or replace function func_test1 (p_num number, p_num1 out number) return number is
Call: SQL call: all name (); command line call: exec name; Self call: Name; package:
Establish a package specification: only declarations are not implemented, which is equivalent to interfaces. Create or replace package pac_name is end pac_name; create a package body: create or replace package body pac_name is to implement the content end pac_name;
When calling a package, add the class name as the prefix (package name. component name): parameter type: in cannot be imported only (input parameters cannot be assigned values, and can be passed into Integer constants); out can only be input only (Integer constants cannot be used, but variables can only be passed, input parameters can be assigned values); in-out and inbound and outbound.