# ReturningStatement

open class ReturningStatement(val table: Table, val returningExpressions: List<Expression<*>>, val mainStatement: Statement<*>) : Statement<ResultSet> , Iterable<ResultRow>

Represents the underlying SQL mainStatement that also returns a result set with data from any modified rows.

#### Parameters

table

Table to perform the main statement on and return results from.

returningExpressions

Columns or expressions to include in the returned result set.

mainStatement

The statement to append the RETURNING clause to. This may be an insert, update, or delete statement.

## Constructors

ReturningStatement
Link copied to clipboard
constructor(table: Table, returningExpressions: List<Expression<*>>, mainStatement: Statement<*>)

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

mainStatement
Link copied to clipboard
val mainStatement: Statement<*>
returningExpressions
Link copied to clipboard
val returningExpressions: List<Expression<*>>
table
Link copied to clipboard
val table: Table
targets
Link copied to clipboard
val targets: List<Table>
type
Link copied to clipboard
val type: StatementType

## Functions

appendTo
Link copied to clipboard
fun <T> Iterable<T>.appendTo(builder: QueryBuilder, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", transform: QueryBuilder.(T) -> Unit): QueryBuilder

Appends all the elements separated using separator and using the given prefix and postfix if supplied.

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): ResultSet?

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): ResultSet

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.

forEach
Link copied to clipboard
open fun forEach(p0: Consumer<in ResultRow>)
iterator
Link copied to clipboard
open operator override fun iterator(): Iterator<ResultRow>
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.

spliterator
Link copied to clipboard
open fun spliterator(): Spliterator<ResultRow>