I. What is PL/SQL?
PL/SQL (procedural language/sql) is an extension of Oracle in the standard SQL language.
PL/SQL not only allows the embedding of the language, but also defines variables and constants, allows the use of conditional and circular statements, and allows the use of exceptions to handle various errors, making it more powerful.
Second, why to learn PL/SQL
1. Improve the performance of your application
2. Modular design ideas (pagination process, order process, transfer process). )
3. Reduce network traffic
4. Improve security (SQL will include the table name, and sometimes may have a password, when the transmission will be leaked.) PL/SQL will not be)
Third, why Oracle in PL/SQL developer execution quickly, with C # OracleClient execution is slow
Because PL/SQL is a language specifically designed to access Oracle databases in a variety of environments. Because the language is integrated into the database server, PL/SQL code can quickly and efficiently process the data.
and the C # language is Microsoft's product, it is connected to the Oracle when the "connection pool", so the first time will be slow, but when your Web application does not restart, the future speed will not be slow.
Iv. disadvantages of using PL/SQL
Transplant is not good (Exchange database is not used)
V. PL/SQL Understanding
1), stored procedures, functions, triggers are written in PL/SQL
2), stored procedures, functions, triggers are present in Oracle
3), PL/SQL is a very powerful database process language
4), stored procedures, functions can be called in Java
Vi. write a stored procedure that can add records to a table.
1. Create a simple table
CREATE TABLE mytest (
Username VARCHAR2 (30),
PWD VARCHAR2 (30)
);
2. The creation process (replace: Indicates that if there is insert_proc, it is replaced)
CREATE OR REPLACE PROCEDURE Insert_proc is
BEGIN
INSERT into MyTest VALUES (' Lin Yi-chin ', ' 123456 ');
END;
/
Note to execute in the command window
eg, exec Insert_proc;
Note to execute in the command window
19. Introduction to Oracle PL/SQL