DB2 Scalar functions - BOOLEAN


Volta a página anterior

Volta ao Menu das scalar functions

Volta ao Menu Principal


Desenvolvido por DORNELLES Carlos Alberto - Analista de Sistemas - Brasília DF. - cad_cobol@hotmail.com

BOOLEAN

The BOOLEAN function returns the actual Boolean value that corresponds to a non-Boolean representation of a Boolean value.

BOOLEAN ( numeric-expressionstring-expression )

The schema is SYSIBM.

numeric-expression
An expression that returns a binary integer or floating decimal value.
The result is TRUE if the returned value is non-zero and FALSE if it is zero.
string-expression
An expression that returns a character-string or Unicode graphic-string representation of a Boolean value.
Leading and trailing blanks are eliminated from the string before it is evaluated.

The returned string must be a valid representation of a Boolean value as described in Boolean values (SQLSTATE 22018).

The result of the function is the same BOOLEAN value that would result from the expression:

   CAST(string-expression AS BOOLEAN)
If the argument can be null, the result can be null; if the argument is null, the result is the null value.

Examples

  1. The following statement returns a value of data type BOOLEAN with the value TRUE.
       values BOOLEAN(1)
  2. The following statement returns a value of data type BOOLEAN with the value FALSE.
       values BOOLEAN('NO')
  3. The following statement returns a value of data type BOOLEAN with the value TRUE.
       values BOOLEAN('Yes')


© Copyright IBM Corp.