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.54 -r1.55 --- openacs-4/packages/acs-core-docs/www/db-api.html 12 Feb 2019 17:12:18 -0000 1.54 +++ openacs-4/packages/acs-core-docs/www/db-api.html 12 Feb 2019 17:43:02 -0000 1.55 @@ -845,51 +845,7 @@ } -
- db_nullify_empty_string
-
-
-
-db_nullify_empty_string string
-
- For true SQL purists, we provide the convenience function
- db_nullify_empty_string
, which returns
- [db_null] if its string
argument is the empty string
- and can be used to encapsulate another Oracle quirk:
- -set baz "" - -# Clean out the foo table -# -db_dml unused {delete from foo} -db_dml unused {insert into foo(baz) values(:baz)} - -set n_rows [db_string unused "select count(*) from foo where baz is null"] -# -# $n_rows is 1; in effect, the "baz is null" criterion is matching -# the empty string we just inserted (because of Oracle's coercion -# quirk) - -- -
- To balance out this asymmetry, you can explicitly set baz
to
- null
by writing:
-
- -db_dml foo_insert {insert into foo(baz) values(:1)} {[db_nullify_empty_string $baz]} - --