Batch SQL statement execution in Oracle

Source: Internet
Author: User

In actual application, multiple insert statements may be executed at a time. I know two ways to share with you:

1. Write the statement block in tools such as PLSQL between begin end, for example:

Begin

Insert into table values (....);

Insert into table values (....);

Insert into table values (....);

Insert into table values (....);

End;

Remember to add a semicolon after end

2. Run the SQL file by using commands, that is, write multiple SQL statements into one SQL file. For example, there is a. SQL file under the root directory of drive D. The content of a. SQL is as follows:

Insert into table values (....);

Insert into table values (....);

Insert into table values (....);

Insert into table values (....);

Run the CMD command to log on to sqlplus. After Successful Logon, enter @ d:/a. SQL.

3. You can use PLSQL Developer 7.0 to directly execute multiple statements. Each statement must be separated.

--------------------------------------- The following content is reproduced ----------------------------------------------

Objective: To execute multiple SQL statements at a time in PLSQL. Note: it may be difficult to query statements such as SELECT, because which of the result output sets prevails? (Guess: Is the last execution result correct ?) The current idea is to create multiple views at a time. Solution 1: Create a new Command Window, write multiple statements on its Editor page, and then execute! :) Solution 2: write a script, save it to c:/, and then use SQL> c:/1. SQL solution 3: Write a stored procedure, and then execute it (to be sorted)

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.