ORACLE PL/SQL Instance fine solutions in the third chapter

Source: Internet
Author: User
Tags savepoint

3.1 using DML in PL/SQL

In the PL/SQL block, the two variables are assigned the value of a. : = Initialize. B. The SELECT INTO syntax, the declaration portion of a PL/SQL block is declared, and later can be assigned using a SELECT statement.

3.1.1 Variable initialization using SELECT INTO syntax

Select A to v_a INSERT into xxx (table) (XA) VALUES (v_a)

3.1.2 using DML in a PL/SQL statement block

A. Using the Oracle sequence CURR

B. Get and increment sequence values currval The current value of the returned sequence Nextval increment the current sequence value and return the new value

C. Getting numbers from a sequence

3.1.3 using sequences in a PL/SQL statement block

3.2 Using SavePoint

The goal is to use Commint,roolback and savepoint with transactions in a PL/SQL statement block, meaning that the program can be decomposed into manageable units, Ifenjie transactions into smaller elements, to ensure that the application only holds the correct data.

Commit will perpetuate the time in the master rollback will delete the time in the transaction, and can also control the transaction through Savepoin

ORACLE PL/SQL Instance fine solutions in the third chapter

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.