The PL/SQL language is the language that Oracle expands on SQL.
1 procedures, functions, triggers are written in PL/SQL
2 procedures, functions, triggers are in Oracle
3 PL/SQL statements can be called directly in Java
Simple Introduction
Write a stored procedure in Sql-plus that can add records to a table.
First step: Create a table
CREATE TABLE mytest (name varchar2, passwd varchar2 (20));
Step Two: Create a process
CREATE PROCEDURE Mypro1 is begin
--Executive Section
INSERT into MyTest value (' wdx ', ' 123 ')
End
/
--Enter
(Note: If the system later has mypro1 this process name, either change the name or add or replace after create, if there is a mistake, the input follows the input show error)
Step three: Call the procedure
Method 1:exec Procedure Name (parameter value 1, parameter value 2 ...)
Method 2:call Procedure Name (parameter value 1, parameter value 2 ...)
Of course, you can also create the above procedure in PL/SQL developer, similar.
PL/SQL can write procedures, functions, triggers, packages, and so on.
Writing Specifications:
1 notes
Single-line Comment--
Multi-line Comment/*...*/
2 naming conventions for identifying symbols
V_ is recommended as a prefix when defining variables
When defining constants, it is recommended to use the C_
When you define a cursor, we recommend that you use _cursor
When defining an exception error, we recommend that you use E_
PL/SQL is used to write blocks, block structures, three parts, respectively, the definition section, the execution part, the exception processing part,
Declear
/* Define START */
Begin
/* Execute part */
exception
/* Exception Handling section */
End
about Oracle PL/SQL