nsmcp::DatabaseSession method executeDml (public)

 <instance of nsmcp::DatabaseSession[i]> executeDml \
    [ -bindtypes bindtypes ] statement

Defined in /usr/local/ns/tcl/nsmcp/database.tcl

Execute one statement and require a DML result. Execute serialized SQL as supplied; when bindtypes is provided, resolve caller variables through core binding with that explicit type metadata.

Switches:
-bindtypes (optional)
Optional dictionary describing scalar, list, rows or binary bindings.
Parameters:
statement (required)
One trusted SQL statement, with optional named value bindings.
Returns:
An empty result on success; row-returning statements raise an error.

Testcases:
No testcase defined.
Source code:
if {$bindtypes eq {}} {
    set kind [ns_db exec ${:handle} $statement]
} else {
    set kind [uplevel 1 [list ns_db exec ${:handle} -bindvars -bindtypes $bindtypes -- $statement]]
}
if {$kind eq "NS_ROWS"} {
    ns_db flush ${:handle}
    error "Expected a non-row-returning serialized DML statement"
}
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: