wp_prepare_dml table names values { condition " " }What it does:
Prepares a DML statement with columns names and value values. If condition is empty, does an insert - otherwise does an update.Defined in: /web/philip/tcl/wp-defs.tcl
Source code:
if { $condition == "" } { return "insert into ${table}([join $names ",\n "])\nvalues([join $values ",\n "])" } else { set sql "update $table set " for { set i 0 } { $i < [llength $names] } { incr i } { if { $i != 0 } { append sql ",\n " } append sql "[lindex $names $i] = [lindex $values $i]" } append sql "\nwhere $condition" return $sql }