Code Specification
Oracle stored procedures, keyword uppercase, lowercase, and variables start with v_, regulation code to improve readability
Assignment and judge symbol
Oracle stored procedure, using the variable assignment: = sign, is determined directly using the = sign condition.
Variable declaration for an outside begin ... end block.
If the statement
if statement, if not added after (), then add the code before;
else if written as elsif, elsif and else are optional;
There must end end if;
Standard is structured as follows:
if…then
……
elsif ... then - Optional (more)
……
else - Optional
……
end if;
Exception abnormal
There are 20 kinds of predefined exceptions, use the format:
begin
……
exception
when others then
……
end
Refer to: https: //www.cnblogs.com/-maji/p/7235793.html
in out parameters
Input parameters can specify the type of procedure is stored in or out in or out:
CREATE OR REPLACE PROCEDURE println (v_var in/out/in out VARCHAR2)
in: reception parameters, the internal subroutine can not be modified
out: an output value, ignores the value passed, it can be modified within the subroutine
in out: receive incoming argument values; can be modified within the subroutine; may output
Refer to: https://www.cnblogs.com/zy20160117/p/9480341.html