Quick Search:
 
 Oracle PL/SQL: INSERT ALL Jump to:  
Category: >> Oracle PL/SQL >> INSERT ALL  

<< lastnext >>

Snippet Name: INSERT ALL

Description: You can use the INSERT ALL statement without a condition. This provides you with multiple inserts.

Also see:
» INSERT With Returning Clause
» Create Table INSERT (CTAS)
» Inserting into SELECT statement
» INSERT WITH CHECK OPTION
» INSERT FIRST WHEN
» INSERT ALL WHEN
» INSERT WHEN
» INSERT: Using A Record
» INSERT with Select
» INSERT: Multiple Column Table Or View ...
» INSERT: Multiple Column Table Or View ...
» INSERT: Single Column Table Or View
» FORALL Insert
» INSERT

Comment: (none)

Language:
Highlight Mode: HTML4STRICT
Last Modified: March 04th, 2009

INSERT ALL
INTO <table_name> VALUES <column_name_list)
INTO <table_name> VALUES <column_name_list)
...
<SELECT Statement>;
 
--Example:
INSERT ALL
INTO sales (prod_id, cust_id, time_id, amount)
VALUES (product_id, customer_id, weekly_start_date, sales_sun)
INTO sales (prod_id, cust_id, time_id, amount)
VALUES (product_id, customer_id, weekly_start_date+1, sales_mon)
INTO sales (prod_id, cust_id, time_id, amount)
VALUES (product_id, customer_id, weekly_start_date+2, sales_tue)
INTO sales (prod_id, cust_id, time_id, amount)
VALUES (product_id, customer_id, weekly_start_date+3, sales_wed)
INTO sales (prod_id, cust_id, time_id, amount)
VALUES (product_id, customer_id, weekly_start_date+4, sales_thu)
INTO sales (prod_id, cust_id, time_id, amount)
VALUES (product_id, customer_id, weekly_start_date+5, sales_fri)
INTO sales (prod_id, cust_id, time_id, amount)
VALUES (product_id, customer_id, weekly_start_date+6, sales_sat)
SELECT product_id, customer_id, weekly_start_date, sales_sun,
sales_mon, sales_tue, sales_wed, sales_thu, sales_fri, sales_sat
FROM sales_input_table;


 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org