29/11/2012

[SQL] Oracle insert multiple rows with single statement

In Oracle, to insert multiple rows from a single INSERT statement you can:

INSERT ALL
INTO table(column_list) VALUES (values)
INTO table1(column_list1) VALUES (values1)

...
SELECT *
FROM dual;

Should you need to, you may actually write your own SELECT statement. You can insert data into multiple tables at once too.

No comments:

Post a Comment

With great power comes great responsibility.

Da grandi poteri derivano grandi responsabilità.