Rod Pope
2008-09-16 23:48:35 UTC
The company I'm consulting for has a large number of applications currently running under dBPlus 2.61.5. The comments below on bugs with NULL fields come from several errors in multiple apps.
from page 4 of the dBL Language Reference
String data
. . . A string with no characters is called an empty string or a null string (not to be confused with the null data type).
Questions: Is a character field in a table where no data has ever been entered a null string or a null data type? Why does the entire string in a concatenation operation ("anything" ± variable) become a null string if the variable is null? An undefined character type field or other type converted to string for concatenation should be a null string, NOT a null data type which follows the Note for the plus operator below.
from page 4 of the dBL Language Reference
Logical data
A logical, or boolean, value can be only one of three things: true, false or null. These logical values are expressed literally in dBL by the keywords true, false and null.
Question: When doing a REPLACE operation of a logical field to a new record in one table with data from a logical field in another table, what value should be in the "to" field when the "from" field is null?
In my current application, the answer is "TRUE" That is a bug!
from page 5 of the dBL Language Reference
A null value is different from a blank or zero value; null is the absence of a value.
A null value in a field would indicate that no data has been entered into the field, like in a new row, or that the field has been emptied on purpose. In certain summary operations, null fields are ignored. For example, if you are averaging a numeric field, rows with a null value in the field are ignored. If instead a null value was considered to be zero or some other value, it would affect the average.
Questions: What operation is used to "empty on purpose"? What are the other "summary operations"?
from page 21 of the dBL Language Reference
+ (plus) operator
Addition, concatenation, unary positive operator.
.
.
.
Note Adding the value null to anything (or anything to null) results in the value null.
Question: Why is this note true? Recently we added a new part to our parts database with a zero cost (giveaways at shows). The data entry clerk skipped the "Price per Unit" field during data entry, leaving it undefined (null). When the invoice was created, the total was $0.00 (numeric formatted nulls print as zero). Why is the global default for a numeric not zero?
from page 4 of the dBL Language Reference
String data
. . . A string with no characters is called an empty string or a null string (not to be confused with the null data type).
Questions: Is a character field in a table where no data has ever been entered a null string or a null data type? Why does the entire string in a concatenation operation ("anything" ± variable) become a null string if the variable is null? An undefined character type field or other type converted to string for concatenation should be a null string, NOT a null data type which follows the Note for the plus operator below.
from page 4 of the dBL Language Reference
Logical data
A logical, or boolean, value can be only one of three things: true, false or null. These logical values are expressed literally in dBL by the keywords true, false and null.
Question: When doing a REPLACE operation of a logical field to a new record in one table with data from a logical field in another table, what value should be in the "to" field when the "from" field is null?
In my current application, the answer is "TRUE" That is a bug!
from page 5 of the dBL Language Reference
A null value is different from a blank or zero value; null is the absence of a value.
A null value in a field would indicate that no data has been entered into the field, like in a new row, or that the field has been emptied on purpose. In certain summary operations, null fields are ignored. For example, if you are averaging a numeric field, rows with a null value in the field are ignored. If instead a null value was considered to be zero or some other value, it would affect the average.
Questions: What operation is used to "empty on purpose"? What are the other "summary operations"?
from page 21 of the dBL Language Reference
+ (plus) operator
Addition, concatenation, unary positive operator.
.
.
.
Note Adding the value null to anything (or anything to null) results in the value null.
Question: Why is this note true? Recently we added a new part to our parts database with a zero cost (giveaways at shows). The data entry clerk skipped the "Price per Unit" field during data entry, leaving it undefined (null). When the invoice was created, the total was $0.00 (numeric formatted nulls print as zero). Why is the global default for a numeric not zero?