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.97.2.16 -r1.97.2.17 --- openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl 9 Sep 2014 08:39:39 -0000 1.97.2.16 +++ openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl 10 Sep 2014 13:54:53 -0000 1.97.2.17 @@ -506,6 +506,7 @@ # DB driver functions, optimized for PostgreSQL # ::xo::db::DB-postgresql instproc 0or1row {qn sql} { + if {$sql eq ""} {set sql [my get_sql $qn]} set answers [uplevel [list [self] exec_0or1row $sql]] if {$answers ne ""} { foreach {att val} [ns_set array $answers] { uplevel [list set $att $val] } @@ -515,6 +516,7 @@ return 0 } ::xo::db::DB-postgresql instproc 1row {qn sql} { + if {$sql eq ""} {set sql [my get_sql $qn]} set answers [uplevel [list [self] exec_0or1row $sql]] if {$answers ne ""} { foreach {att val} [ns_set array $answers] { uplevel [list set $att $val] } @@ -524,6 +526,7 @@ error "query $sql did not return an answer" } ::xo::db::DB-postgresql instproc get_value {qn sql {default ""}} { + if {$sql eq ""} {set sql [my get_sql $qn]} set answers [uplevel [list [self] exec_0or1row $sql]] if {$answers ne ""} { set result [ns_set value $answers 0] @@ -533,6 +536,7 @@ return $default } ::xo::db::DB-postgresql instproc list_of_lists {qn sql} { + if {$sql eq ""} {set sql [my get_sql $qn]} db_with_handle db { set result [list] set answers [uplevel [list ns_pg_bind select $db $sql]] @@ -546,6 +550,7 @@ return $result } ::xo::db::DB-postgresql instproc list {qn sql} { + if {$sql eq ""} {set sql [my get_sql $qn]} db_with_handle db { set result [list] set answers [uplevel [list ns_pg_bind select $db $sql]]