DB2 Version 9.7 for Linux, UNIX, and Windows

NCHAR scalar function

Integer to nchar

Read syntax diagramSkip visual syntax diagram
>>-NCHAR--(--integer-expression--)-----------------------------><

Decimal to nchar

Read syntax diagramSkip visual syntax diagram
>>-NCHAR--(--decimal-expression--+----------------------+--)---><
                                 '-,--decimal-character-'      

Floating-point to nchar

Read syntax diagramSkip visual syntax diagram
>>-NCHAR--(--floating-point-expression--+----------------------+--)-><
                                        '-,--decimal-character-'      

Decimal floating-point to nchar

Read syntax diagramSkip visual syntax diagram
>>-NCHAR--(--decimal-floating-point-expression--+----------------------+--)-><
                                                '-,--decimal-character-'      

Character to nchar

Read syntax diagramSkip visual syntax diagram
>>-NCHAR--(--character-expression--+------------+--)-----------><
                                   '-,--integer-'      

Nchar to nchar

Read syntax diagramSkip visual syntax diagram
>>-NCHAR--(--national-character-expression--+------------+--)--><
                                            '-,--integer-'      

Datetime to nchar

Read syntax diagramSkip visual syntax diagram
>>-NCHAR--(--datetime-expression--+--------------+--)----------><
                                  '-,--+-ISO---+-'      
                                       +-USA---+        
                                       +-EUR---+        
                                       +-JIS---+        
                                       '-LOCAL-'        

The schema is SYSIBM. The function name cannot be specified as a qualified name when keywords are used in the function signature.

The NCHAR function can be specified only in a Unicode database (SQLSTATE 560AA).

The NCHAR function returns a fixed-length national character string representation of:
  • An integer number, if the first argument is a SMALLINT, INTEGER, or BIGINT
  • A decimal number, if the first argument is a decimal number
  • A double-precision floating-point number, if the first argument is a DOUBLE or REAL
  • A decimal floating-point number, if the argument is a decimal floating-point number (DECFLOAT)
  • A character string, if the first argument is any type of character string
  • A national character string, if the first argument is any type of national character string
  • A datetime value, if the first argument is a DATE, TIME, or TIMESTAMP

The NCHAR scalar function is a synonym for the GRAPHIC scalar function.