about Oracle PL/SQL

Source: Internet
Author: User

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

See also: http://www.cnblogs.com/linjiqin/archive/2012/02/22/2363781.html

about Oracle PL/SQL

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.