Issue Details (XML | Word | Printable)

Key: CORE-1978
Type: Improvement Improvement
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Gustavo Torres
Votes: 18
Watchers: 12
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Extend INSERT to support inserting multiple rows in single command (ala PostgreSQL/MySQL)

Created: 05/Jul/08 02:11 AM   Updated: 30/Jun/20 07:38 AM
Component/s: Engine
Affects Version/s: None
Fix Version/s: None

Environment: Software platform


 Description  « Hide
I suggest include INSERT for multi-values

INSERT INTO Table (a, b, c)
 values(1, 2, 3), (4, 5, 6);

for improvement performance insert

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Dimitry Sibiryakov added a comment - 03/Aug/10 09:55 AM
In ISQL it is already implemented as bulk_insert. In DSQL it is less effective than array DML. What's the point?

Gustavo Torres added a comment - 08/Sep/10 02:49 AM
I want an easy way for to send in one transaction multiples rows, around 500 rows or less.

Karol Bieniaszewski added a comment - 08/Nov/10 08:14 AM
this is already implemented feature
use execute block with many inserts
example:
 

execute block
as
insert into t(a, b, c) values(1,2,3);
insert into t(a, b, c) values(4,5,6);
insert into t(a, b, c) values(7,8,9);
........

end

Dmitry Yemanov added a comment - 08/Nov/10 08:27 AM
Karol, the requested multi-value INSERT statement is a standard feature, so I believe the request is perfectly valid regardless of our EXECUTE BLOCK feature (which can be used as a temporary workaround though).

Sean Leyne added a comment - 25/Apr/14 05:32 PM
Edited the subject to correct terminology (rows vs. values), clarify requirement (single command vs. complex SELECT UNION/Inline PSQL [i.e. EXECUTE BLOCK solution] as well as identifying that the engines which support the single command approach are PostgreSQL and MySQL (MS SQL does not support at all, Oracle has an odd variation).

Eli Godoy added a comment - 28/Jan/16 10:50 PM
I have 200-250 fields, I need to put ALL fields in each insert?

Stefan Heymann added a comment - 30/Jun/20 07:38 AM
> What's the point?
A smaller command that has to go over the network. Imagine you have a table with only one or two columns and want to insert many rows. The resulting command is much smaller. And it probably is faster for the server to process because it doesn't have to do the parsing for the "into" part everytime.