# insertIgnore

suspend fun <T : Table> T.insertIgnore(body: T.(UpdateBuilder<*>) -> Unit): InsertStatement<Long>

Represents the SQL statement that inserts a new row into a table, while ignoring any possible errors that occur during the process.

For example, if the new row would violate a unique constraint, its insertion would be ignored. Note: `INSERT IGNORE` is not supported by all vendors. Please check the documentation.

#### Samples

org.jetbrains.exposed.v1.r2dbc.sql.tests.shared.dml.InsertTests.testInsertIgnoreAndGetIdWithPredefinedId

suspend fun <T : Table> T.insertIgnore(selectQuery: AbstractQuery<*>, columns: List<Column<*>>? = null): Int?

Represents the SQL statement that uses data retrieved from a selectQuery to insert new rows into a table, while ignoring any possible errors that occur during the process.

Note: `INSERT IGNORE` is not supported by all vendors. Please check the documentation.

#### Return

The number of inserted rows, or `null` if nothing was retrieved after statement execution.

#### Parameters

selectQuery

Source `SELECT` query that provides the values to insert.

columns

Columns to insert the values into. This defaults to all columns in the table that are not auto-increment columns without a valid sequence to generate new values.