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 ...@@ -34,11 +34,11 @@ sqlgroup: Formats complex SQL expressions
select * from employees select * from employees
<dtml-sqlgroup where> <dtml-sqlgroup where>
<dtml-sqltest salary op=gt type=float optional> <dtml-sqltest salary op="gt" type="float" optional>
<dtml-and> <dtml-and>
<dtml-sqltest first op=eq type=string multiple optional> <dtml-sqltest first type="nb" multiple optional>
<dtml-and> <dtml-and>
<dtml-sqltest last op=eq type=string multiple optional> <dtml-sqltest last type="nb" multiple optional>
</dtml-sqlgroup> </dtml-sqlgroup>
If 'first' is 'Bob' and 'last' is 'Smith, McDonald' it renders:: If 'first' is 'Bob' and 'last' is 'Smith, McDonald' it renders::
...@@ -64,12 +64,12 @@ sqlgroup: Formats complex SQL expressions ...@@ -64,12 +64,12 @@ sqlgroup: Formats complex SQL expressions
select * from employees select * from employees
<dtml-sqlgroup where> <dtml-sqlgroup where>
<dtml-sqlgroup> <dtml-sqlgroup>
<dtml-sqltest first op=like type=string> <dtml-sqltest first op="like" type="nb">
<dtml-and> <dtml-and>
<dtml-sqltest last op=like type=string> <dtml-sqltest last op="like" type="nb">
<dtml-sqlgroup> <dtml-sqlgroup>
<dtml-or> <dtml-or>
<dtml-sqltest salary op=gt type=float> <dtml-sqltest salary op="gt" type="float">
</dtml-sqlgroup> </dtml-sqlgroup>
Given sample arguments, this template renders to SQL like so:: Given sample arguments, this template renders to SQL like so::
......
...@@ -18,9 +18,10 @@ sqltest: Formats SQL condition tests ...@@ -18,9 +18,10 @@ sqltest: Formats SQL condition tests
Attributes Attributes
type=string -- The type of the variable. Valid types include: type=string -- The type of the variable. Valid types include:
'string', 'int', 'float' and 'nb'. 'nb' means non-blank 'string', 'int', 'float' and 'nb'. 'nb' means non-blank string,
string. The type attribute is required and is used to properly and should be used instead of 'string' unless you want to test for
escape inserted variable. 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 column=string -- The name of the SQL column to test against. This
attribute defaults to the variable name. attribute defaults to the variable name.
...@@ -54,7 +55,7 @@ sqltest: Formats SQL condition tests ...@@ -54,7 +55,7 @@ sqltest: Formats SQL condition tests
Basic usage:: Basic usage::
select * from employees select * from employees
where <dtml-sqltest name type="string"> where <dtml-sqltest name type="nb">
If the 'name' variable is 'Bob' then this renders:: If the 'name' variable is 'Bob' then this renders::
......
...@@ -16,8 +16,9 @@ sqlvar: Inserts SQL variables ...@@ -16,8 +16,9 @@ sqlvar: Inserts SQL variables
Attributes Attributes
type=string -- The type of the variable. Valid types include: type=string -- The type of the variable. Valid types include:
'string', 'int', 'float' and 'nb'. 'nb' means non-blank 'string', 'int', 'float' and 'nb'. 'nb' means non-blank string and
string. The type attribute is required and is used to properly 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. escape inserted variable.
optional=boolean -- If true and the variable is null or optional=boolean -- If true and the variable is null or
...@@ -28,7 +29,7 @@ sqlvar: Inserts SQL variables ...@@ -28,7 +29,7 @@ sqlvar: Inserts SQL variables
Basic usage:: Basic usage::
select * from employees select * from employees
where name=<dtml-sqlvar name type="string"> where name=<dtml-sqlvar name type="nb">
This SQL quotes the 'name' string variable. 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