xo::db::DB-postgresql instproc dml (public)

 <instance of xo::db::DB-postgresql[i]> dml [ -dbn dbn ] \
    [ -bind bind ] [ -prepare prepare ] qn sql

Defined in /var/www/openacs/packages/xotcl-core/tcl/05-db-procs.tcl

Execute a data modification statement.

Switches:
-dbn (optional)
Database name, or empty for the default.
-bind (optional)
Query bind values.
-prepare (optional)
Optional prepared-statement argument types.
Parameters:
qn (required)
Query name.
sql (required)
SQL statement.
Returns:
The number of affected rows.

Testcases:
xotcl_core_tutorial_2, xotcl_core_tutorial_4, test_cr_items, xowiki_test_cases, slot_interactions
Source code:
if {$sql eq ""} {set sql [:get_sql $qn]}
if {$bind ne ""} {set bindOpt [list -bind $bind]} {set bindOpt ""}
set bind $bindOpt
db_with_handle -dbn [:map_default_dbn $dbn] db {
  if {[info exists prepare]} {set sql [:prepare -handle $db -argtypes $prepare $sql]}
  ::db_exec dml $db [uplevel [list [self] qn $qn]] $sql 2
}
return [db_resultrows]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: