Index: openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl,v diff -u -r1.103.2.8 -r1.103.2.9 --- openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl 30 Mar 2016 10:31:29 -0000 1.103.2.8 +++ openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl 14 Oct 2016 11:29:36 -0000 1.103.2.9 @@ -463,8 +463,8 @@ } ::xo::db::DB instproc foreach {{-dbn ""} {-bind ""} qn sql body} { + if {$sql eq ""} {set sql [my get_sql $qn]} if {$bind ne ""} {set bindOpt [list -bind $bind]} {set bindOpt ""} - set qn [uplevel [list [self] qn $qn]] uplevel [list ::db_foreach -dbn $dbn $qn $sql $body {*}$bindOpt] }