klyn.data.EntityManager.sqlExecute
method
public sqlExecute(
sql as String,
parameters as klyn.data.sql.SQLParameters = klyn.data.sql.SQLParameters()
) as Long:
Description

Executes one parameterized raw SQL mutation in the active transaction.

Parameters
ParameterDescription
sqlExplicit SQL text for the configured dialect.
parametersOrdered prepared-statement values.
Returns

Number of affected rows reported by the driver.

Throws
  • TransactionRequiredException when no transaction is active.
  • ProviderCapabilityException for a non-SQL manager.
Example
transaction = manager.beginTransaction()
affected = manager.sqlExecute(
"update T_Users set disabled = ? where id = ?",
SQLParameters(true, userId)
)
transaction.commit()