Commit 42c7a945 authored by Amos Latteier's avatar Amos Latteier

clarified nb versus string

parent 7611b0c2
......@@ -34,11 +34,11 @@ sqlgroup: Formats complex SQL expressions
select * from employees
<dtml-sqlgroup where>
<dtml-sqltest salary op=gt type=float optional>
<dtml-sqltest salary op="gt" type="float" optional>
<dtml-and>
<dtml-sqltest first op=eq type=string multiple optional>
<dtml-sqltest first type="nb" multiple optional>
<dtml-and>
<dtml-sqltest last op=eq type=string multiple optional>
<dtml-sqltest last type="nb" multiple optional>
</dtml-sqlgroup>
If 'first' is 'Bob' and 'last' is 'Smith, McDonald' it renders::
......@@ -64,12 +64,12 @@ sqlgroup: Formats complex SQL expressions
select * from employees
<dtml-sqlgroup where>
<dtml-sqlgroup>
<dtml-sqltest first op=like type=string>
<dtml-sqltest first op="like" type="nb">
<dtml-and>
<dtml-sqltest last op=like type=string>
<dtml-sqltest last op="like" type="nb">
<dtml-sqlgroup>
<dtml-or>
<dtml-sqltest salary op=gt type=float>
<dtml-sqltest salary op="gt" type="float">
</dtml-sqlgroup>
Given sample arguments, this template renders to SQL like so::
......
......@@ -18,9 +18,10 @@ sqltest: Formats SQL condition tests
Attributes
type=string -- The type of the variable. Valid types include:
'string', 'int', 'float' and 'nb'. 'nb' means non-blank
string. The type attribute is required and is used to properly
escape inserted variable.
'string', 'int', 'float' and 'nb'. 'nb' means non-blank string,
and should be used instead of 'string' unless you want to test for
blank values. The type attribute is required and is used to
properly escape inserted variable.
column=string -- The name of the SQL column to test against. This
attribute defaults to the variable name.
......@@ -54,7 +55,7 @@ sqltest: Formats SQL condition tests
Basic usage::
select * from employees
where <dtml-sqltest name type="string">
where <dtml-sqltest name type="nb">
If the 'name' variable is 'Bob' then this renders::
......
......@@ -16,8 +16,9 @@ sqlvar: Inserts SQL variables
Attributes
type=string -- The type of the variable. Valid types include:
'string', 'int', 'float' and 'nb'. 'nb' means non-blank
string. The type attribute is required and is used to properly
'string', 'int', 'float' and 'nb'. 'nb' means non-blank string and
should be used in place of 'string' unless you want to use blank
strings. The type attribute is required and is used to properly
escape inserted variable.
optional=boolean -- If true and the variable is null or
......@@ -28,7 +29,7 @@ sqlvar: Inserts SQL variables
Basic usage::
select * from employees
where name=<dtml-sqlvar name type="string">
where name=<dtml-sqlvar name type="nb">
This SQL quotes the 'name' string variable.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment