FORALL and bulk collect statements for Oracle databases

Source: Internet
Author: User

FORALL and bulk collect statements for Oracle databases

Let's take a look at the execution process of PL/SQL blocks: When the PL/SQL runtime engine processes a piece of code, it uses the PL/SQL engine to execute Procedural Code, the SQL statement is sent to the SQL engine for execution. After the SQL engine completes execution, the result is returned to the PL/SQL engine. This kind of interaction between PL/SQL engine and SQL engine is called context switch ). Each exchange brings additional costs.

 

  1. FORALL is used to enhance the exchange between PL/SQL engines and SQL engines.
  2. Bulk collect is used to enhance the exchange between SQL engines and PL/SQL engines. (We have already introduced it)

1. FORALL Introduction

With FORALL, multiple DML can be batch sent to the SQL engine for execution, minimizing the overhead of context interaction. The following is one of FORALL:

Syntax:

 

1 FORALL index_name IN 2 {lower_bound .. upper_bound3 | INDICES

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.