English | 简体中文

api-docs / org.ktorm.database / SqlDialect / executeUpdateAndRetrieveKeys

executeUpdateAndRetrieveKeys

open fun executeUpdateAndRetrieveKeys(
    database: Database,
    sql: String,
    args: List<ArgumentExpression<*>>
): Pair<Int, CachedRowSet>
(source code)

Execute the given SQL string (typically an insert statement), then return the effected row count along with
the generated keys.

Parameters

database - the database instance executing the statement.

sql - the formatted SQL statement.

args - the arguments to be provided to the statement.

Since
2.7

Return
a Pair combines the effected row count and the generated keys.