# DeleteStatement

open class DeleteStatement(val targetsSet: ColumnSet, val where: Op<Boolean>? = null, val isIgnore: Boolean = false, val limit: Int? = null, val targetTables: List<Table> = emptyList()) : Statement<Int>

Represents the SQL statement that deletes one or more rows of a table.

#### Parameters

targetsSet

Column set to delete rows from. This may be a Table or a Join instance.

where

Condition that determines which rows to delete.

isIgnore

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

limit

Maximum number of rows to delete.

targetTables

List of specific tables from targetsSet to delete rows from.

## Constructors

DeleteStatement
Link copied to clipboard
constructor(table: Table, where: Op<Boolean>?, isIgnore: Boolean, limit: Int?, offset: Long?)
constructor(targetsSet: ColumnSet, where: Op<Boolean>? = null, isIgnore: Boolean = false, limit: Int? = null, targetTables: List<Table> = emptyList())

## Types

Companion
Link copied to clipboard
object Companion

## Properties

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
limit
Link copied to clipboard
val limit: Int? = null
offset
Link copied to clipboard
val offset: Long? = null
table
Link copied to clipboard
val table: Table
targets
Link copied to clipboard
val targets: List<Table>
targetsSet
Link copied to clipboard
val targetsSet: ColumnSet
targetTables
Link copied to clipboard
val targetTables: List<Table>
type
Link copied to clipboard
val type: StatementType
where
Link copied to clipboard
val where: Op<Boolean>? = null

## 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.