KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: INSERT command now supports multi-row inserts
PRODUCT: 4D | VERSION: 11.3 | PLATFORM: Mac & Win
Published On: January 14, 2009

As of 4D v11 SQL Release 3, the SQL INSERT command now supports multi-row inserts.

The following examples both insert 3 records into Table_1. The first example uses a multi-row insert while the second example uses single-row inserts.

Example 1, now possible in 4D v11 SQL Release 3:

Begin SQL
    INSERT INTO Table_1 (Field_1, Field_3) VALUES ('1','3'), ('2','4'),('3','5');
End SQL

Example 2, still possible, but no longer necessary:

Begin SQL
    INSERT INTO Table_1 (Field_1, Field_3) VALUES ('1','3');
    INSERT INTO Table_1 (Field_1, Field_3) VALUES ('2','4');
    INSERT INTO Table_1 (Field_1, Field_3) VALUES ('3','5');

End SQL