Index: openacs-4/packages/acs-core-docs/www/db-api.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/db-api.adp,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/acs-core-docs/www/db-api.adp 24 May 2018 06:54:57 -0000 1.5 +++ openacs-4/packages/acs-core-docs/www/db-api.adp 12 Feb 2019 17:12:18 -0000 1.6 @@ -216,19 +216,7 @@ # null, because Oracle has coerced the empty string (even for the # numeric column "bar") into null in both cases -
Since databases other than Oracle do not coerce empty strings
-into null
, this code has
-different semantics depending on the underlying database (i.e., the
-row that gets inserted may not have null as its column values),
-which defeats the purpose of SQL abstraction.
Therefore, the Database Access API provides a
-database-independent way to represent null
(instead of the Oracle-specific idiom
-of the empty string): db_null
.
Use it instead of the empty string whenever you want to set a
-column value explicitly to null
, e.g.:
set bar [db_null] -set baz [db_null] - -db_dml foo_create "insert into foo(bar, baz) values(:bar, :baz)" -# -# sets the values for both the "bar" and "baz" columns to null+
Technically it's equivalent to using a code block on the end of your db_multirow.
-db_null
db_null
Returns a value which can be used in a bind variable to
-represent the SQL value null
.
-See Nulls and Bind Variables
-above.
db_foreach
db_foreach statement-name sql [ -bind bind_set_id | -bind bind_value_list ] \ @@ -615,4 +597,4 @@ rightLink="templates" rightLabel="Next" rightTitle="Using Templates in OpenACS" homeLink="index" homeLabel="Home" upLink="dev-guide" upLabel="Up"> - \ No newline at end of file +