Index: openacs-4/packages/acs-core-docs/www/db-api-detailed.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/db-api-detailed.adp,v diff -u -r1.1.2.4 -r1.1.2.5 --- openacs-4/packages/acs-core-docs/www/db-api-detailed.adp 2 Jan 2016 21:55:21 -0000 1.1.2.4 +++ openacs-4/packages/acs-core-docs/www/db-api-detailed.adp 9 Jun 2016 08:44:49 -0000 1.1.2.5 @@ -217,9 +217,9 @@ Useful

Why bother with bind variables at all - why not just write the Tcl statement above like this:

 
-db_dml presentation_delete {
-    delete from wp_presentations where presentation_id = :some_presentation_id
-}
+db_dml presentation_delete "
+    delete from wp_presentations where presentation_id = $some_presentation_id
+"
 
 

(Note the use of double-quotes to allow the variable reference to $some_presentation_id to be @@ -498,7 +498,7 @@ insert photos(photo_id, image, thumbnail_image) values(photo_id_seq.nextval, empty_blob(), empty_blob()) returning image, thumbnail_image into :1, :2 - } -blob_files [list "/var/tmp/the_photo" "/var/tmp/the_thumbnail"] + } -blob_files [list "/var/tmp/the_photo" "/var/tmp/the_thumbnail"]

This inserts a new row into the photos table, with the contents of the files /var/tmp/the_photo and @@ -541,12 +541,12 @@ proc replace_the_foo { col } { db_transaction { db_dml delete {delete from foo} - db_dml insert {insert into foo(col) values(:col)} + db_dml insert {insert into foo(col) values($col)} } } proc print_the_foo {} { - doc_body_append "foo is [db_string get_foo {select col from foo}]<br>\n" + doc_body_append "foo is [db_string "select col from foo"]<br>\n" } replace_the_foo 8 @@ -699,8 +699,8 @@ script and should never be referenced directly by user code. Returns the current rdbms type and version.

-
($‌Id: db-api.xml,v 1.11 2014/10/27 16:39:31 -victorg Exp $)
+
($‌Id: db-api.xml,v 1.11.2.1 2016/01/02 21:55:21 +gustafn Exp $)