Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 11 Null Processing : Behavior of Nulls

Behavior of Nulls
The context in which a null is used determines its behavior. The following sections describe the behavior of a null depending on its context.
Conversion
TIBCO Object Service Broker provides automatic conversion from one syntax to another when required:
Character null or empty string (''), and numeric null
Assignment
When an assignment is made to a field, the value being assigned is converted to the syntax of the field. When an assignment of a null is made to a local variable, the type and syntax of the local variable becomes the same as the value being assigned to it:
Table Parameters
When a parameter of a table is specified, the value provided is converted to the syntax of the parameter:
This is an invalid value and the DATAREFERENCE exception is raised.
This is an invalid value and the DATAREFERENCE exception is raised.
This is an invalid value and the DATAREFERENCE exception is raised.
This is an invalid value and the DATAREFERENCE exception is raised.
Rules Arguments
When a null value is passed to the argument of a rule, the type and syntax of the argument becomes the same as the null value being passed:
Routine Arguments
When a value is passed to the argument of a TIBCO Object Service Broker routine (a tool written in non-rules code), it is converted to the syntax of the formal argument:
Expressions
Expressions in TIBCO Object Service Broker are evaluated at two different points: when a selection is encountered (for example, field1 = *.field2 + 40), and when the rule is being executed.
Arithmetic on a numeric null or RD null.
The current occurrence is discarded and evaluation of other occurrences continues.
Arithmetic on a numeric null or RD null.
Selection or execution
Arithmetic on a character null.
Selection or execution
Concatenation on a numeric null or RD null.
Relational Expressions
The following relational expressions involving null are true:
The relational expressions that use the form:
<expression> <relational operator> <expression>
can appear in a rules condition, or as part of selection within a WHERE clause. Within selection, an empty string can be passed into selection statements that use the LIKE operator.
Ordering
For the purpose of ordering, null is considered to be less than any value. Occurrences with a null field appear first when they are ORDERED ASCENDING on that field.
Primary and Secondary Keys
A primary key field cannot contain a null value. Nulls are permitted for secondary key fields that have a character semantic type.
Required Fields
In general, fields that are defined as required cannot contain null values. An INSERT results in an INSERTFAIL exception and a REPLACE results in a REPLACEFAIL exception.
When a populated table has its definition modified, exceptions can arise as a result of:
Subsequent updates to the table cause the appropriate exceptions to be raised.
Default Values
Default values replace assigned null values. Fields that have a default value specified and no assignment made to them, or that are assigned a null value, have the default value assigned to them immediately before an occurrence insertion or replacement.
Default value specified.
Default value specified.
Null value replaced by the default value.
Unassigned Fields
An unassigned field can be referenced by giving it a reference value of null.
LOCAL1=table.field;
LOCAL1=table.field;
Indirect Names
Nulls are not allowed as values for an indirect reference. If, during processing, an indirect reference evaluates to a null value, the transaction terminates and an ERROR exception is raised. The exception is trapped with ON ERROR.
Initialization of Local Variables
When a local variable is allocated, its initial value is an empty string ('').

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved