Index: openacs.org-dev/packages/acs-tcl/tcl/00-database-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/acs-tcl/tcl/00-database-procs.tcl,v diff -u -r1.1.1.2 -r1.1.1.3 --- openacs.org-dev/packages/acs-tcl/tcl/00-database-procs.tcl 31 Jul 2002 16:30:56 -0000 1.1.1.2 +++ openacs.org-dev/packages/acs-tcl/tcl/00-database-procs.tcl 8 Oct 2002 15:46:49 -0000 1.1.1.3 @@ -4,7 +4,7 @@ @creation-date 15 Apr 2000 @author Jon Salz (jsalz@arsdigita.com) - @cvs-id 10-database-procs.tcl,v 1.4.2.1 2000/11/20 18:23:12 brech Exp + @cvs-id $Id$ } proc_doc db_type { } { @@ -459,10 +459,19 @@ var_name:1, var_name:2, etc, setting var_name:rowcount to the total number of rows, and setting var_name:columns to a - list of column names. Each row also has a column, rownum, automatically + list of column names. + +

+ + Each row also has a column, rownum, automatically added and set to the row number, starting with 1. Note that this will override any column in the SQL statement named 'rownum', also if you're using the Oracle rownum pseudo-column. + +

+ If the -local is passed, the variables defined + by db_multirow will be set locally (useful if you're compiling dynamic templates + in a function or similar situations).

@@ -810,7 +819,7 @@ } 3 { # TCL_BREAK - Abort the transaction and do the break. - ns_db dml $db "abort transaction" + ns_db dml $dbh "abort transaction" db_release_unused_handles break } @@ -828,6 +837,17 @@ db_abort_transaction if { [info exists on_error] && ![empty_string_p $on_error] } { # An on_error block exists, so execute it. + if {[string equal postgresql [db_type]]} { + # JCD: with postgres we abort the transaction prior to + # executing the on_error block since there is nothing + # you can do to "fix it" and keeping it meant things like + # queries in the on_error block would then fail. + # + # Note that the semantics described in the proc doc + # are not possible to support on postresql. + ns_db dml $dbh "abort transaction" + db_release_unused_handles + } set errno [catch { uplevel 1 $on_error } on_errmsg] @@ -843,7 +863,7 @@ } 3 { # TCL_BREAK - ns_db dml $db "abort transaction" + ns_db dml $dbh "abort transaction" db_release_unused_handles break }