# InsertSelectStatement

open class InsertSelectStatement(val columns: List<Column<*>>, val selectQuery: AbstractQuery<*>, val isIgnore: Boolean = false) : Statement<Int>

Represents the SQL statement that uses data retrieved from a selectQuery to insert new rows into a table.

#### Parameters

columns

Columns to insert the values into.

selectQuery

Source SELECT query that provides the values to insert.

isIgnore

Whether to ignore errors or not. Note isIgnore is not supported by all vendors. Please check the documentation.

#### Inheritors

ReplaceSelectStatement

## Constructors

InsertSelectStatement
Link copied to clipboard
constructor(columns: List<Column<*>>, selectQuery: AbstractQuery<*>, isIgnore: Boolean = false)

## Properties

columns
Link copied to clipboard
val columns: List<Column<*>>
isAlwaysBatch
Link copied to clipboard
open val isAlwaysBatch: Boolean

Whether the SQL statement is meant to be performed as part of a batch execution.

isIgnore
Link copied to clipboard
val isIgnore: Boolean = false
selectQuery
Link copied to clipboard
val selectQuery: AbstractQuery<*>
targets
Link copied to clipboard
val targets: List<Table>
type
Link copied to clipboard
val type: StatementType

## Functions

arguments
Link copied to clipboard
open override fun arguments(): Iterable<Iterable<Pair<IColumnType<*>, Any?>>>

Returns all mappings of columns and expression types to their values needed to prepare an SQL statement.

execute
Link copied to clipboard
fun execute(transaction: Transaction): Int?

Executes the SQL statement directly in the provided transaction and returns the generated result, or `null` if either no result was retrieved or if the transaction blocked statement execution.

executeInternal
Link copied to clipboard
open override fun PreparedStatementApi.executeInternal(transaction: Transaction): Int?

Determines the exact way that an SQL statement is executed in a transaction and applies any necessary logic before returning the result generated by the executed statement.

prepared
Link copied to clipboard
open fun prepared(transaction: Transaction, sql: String): PreparedStatementApi

Uses a transaction connection and an sql string representation to return a precompiled SQL statement, stored as an implementation of PreparedStatementApi.

prepareSQL
Link copied to clipboard
open override fun prepareSQL(transaction: Transaction, prepared: Boolean): String

Returns the string representation of an SQL statement.