Wednesday 29 June 2011

Test Functions


5.1      ISNULL

The ISNULL function returns whether a value is NULL. It is available in the Designer and the Workflow Manager.
     ISNULL( value )
Example : The following example checks for null values in the items table:
ISNULL ISNULL ( ITEM_NAME )
ITEM_NAME
RETURN VALUE
Flashlight
0 (FALSE)
NULL
1 (TRUE)
''
0 (FALSE) Empty string is not NULL

5.2      IS_DATE

The IS_DATE function returns whether a value is a valid date. It is available in the Designer and the Workflow Manager.
     IS_DATE( value )
Example : The following expression checks the INVOICE_DATE port for valid dates:
IS_DATE( INVOICE_DATE )
This expression returns data similar to the following:
INVOICE_DATE
RETURN VALUE
NULL
NULL
180
0 (FALSE)
'04/01/98'
0 (FALSE)
'04/01/1998 00:12:15'
1 (TRUE)
'02/31/1998 12:13:55'
0 (FALSE) (February does not have 31 days)
'John Smith'
0 (FALSE)
This function can also be used to validate a date for a specified format for which the syntax is
IS_DATE( value, format )
If the format is not specified, ‘MM/DD/YYYY’ is taken as the default format.

5.3      IS_NUMBER

The IS_NUMBER returns whether a string is a valid number. It is available in the Designer and the Workflow Manager.
     IS_NUMBER( value )
Example : The following expression checks the ITEM_PRICE port for valid numbers:
IS_NUMBER( ITEM_PRICE )
ITEM_PRICE
RETURN VALUE
123.00
1 (True)
-3.45e+3
1 (True)
''
0 (False) Empty string
+123abc
0 (False)
ABC
0 (False)
-ABC
0 (False)
NULL
NULL

5.4      IS_SPACES

The IS_SPACES function returns whether a value consists entirely of spaces. It is available in the Designer and the Workflow Manager.
     IS_SPACES( value )

Example : The following expression checks the ITEM_NAME port for rows that consist entirely of spaces:
IS_SPACES IS_SPACES ( ITEM_NAME )
ITEM_NAME
RETURN VALUE
Flashlight
0 (False)

1 (True)
Regulator system
0 (False)

No comments:

Post a Comment