Index: openacs-4/packages/acs-core-docs/www/db-api.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/db-api.html,v diff -u -r1.22 -r1.23 --- openacs-4/packages/acs-core-docs/www/db-api.html 11 Nov 2003 12:54:57 -0000 1.22 +++ openacs-4/packages/acs-core-docs/www/db-api.html 19 Nov 2003 15:44:50 -0000 1.23 @@ -1,7 +1,5 @@ -The OpenACS Database Access API

The OpenACS Database Access API

- By Pete Su and - Jon Salz. Modified - by Roberto Mello. +The OpenACS Database Access API

The OpenACS Database Access API

+ By Pete Su and Jon Salz. Modified by Roberto Mello.

Overview

One of OpenACS's great strengths is that code written for it is very close to the database. It is very easy to interact with the @@ -76,15 +74,15 @@ and some_table.condition_p = 'foo'

There are a few problems with this: -

  1. +

    1. If the literal value is a huge string, then we waste a lot of time in the database server doing useless parsing. -

    2. +

    3. Second, if the literal value contains characters like single quotes, we have to be careful to double-quote them, because not quoting them will lead to surprising errors. -

    4. +

    5. Third, no type checking occurs on the literal value. Finally, if the Tcl variable is passed in or between web forms or otherwise subject to external modification, @@ -355,9 +353,9 @@

      Performs the SQL query sql, saving results in variables of the form - var_name:1, var_name:2, etc, - setting var_name:rowcount to the total number - of rows, and setting var_name:columns to a + 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 @@ -378,7 +376,7 @@ multirow.

      You may also add additional, computed columns to the multirow, using the - -extend { col_1 col_2 ... } switch. This is + -extend { col_1 col_2 ... } switch. This is useful for things like constructing a URL for the object retrieved by the query.