About
Sql - Insert in Oracle
Insert into a table or a view and as a view is based on table, insert inserts data into tables.
When the number of values matches the number of column, the column list at the beginning is not required but if the structure of the table changes, it will fail.
All datatype and constraint must be honoured.
Articles Related
Insert Statement
Single table
with Select
INSERT
INTO
NAME_OF_THE_TABLE1
(
COLUMN1,
COLUMN2,
...
)
SELECT
COLUMN1,
COLUMN2,
...
FROM
NAME_OF_THE_TABLE2
with Single values
INSERT
INTO
NAME_OF_THE_TABLE1
(
COLUMN1,
COLUMN2,
...
)
VALUES
(
VALUES1,
VALUES2,
...
)
Multi-table
INSERT ALL
WHEN order_total < 1000000 THEN
INTO small_orders
WHEN order_total > 1000000 AND order_total < 2000000 THEN
INTO medium_orders
WHEN order_total > 2000000 THEN
INTO large_orders
SELECT order_id, order_total, sales_rep_id, customer_id
FROM orders;