Limited support BMC provides limited support for this version of the product. As a result, BMC no longer accepts comments in this space. If you encounter problems with the product version or the space, contact BMC Support.BMC recommends upgrading to the latest version of the product. To see documentation for that version, see BMC AMI Command Center for Db2 13.2

RIGHT function


The RIGHT function returns the rightmost string of characters of the specified length.

RIGHT.png

The arguments are defined as follows:

stringExpression

Specifies the rightmost characters of an input string

The input string expression must be in one of the following data types:

  • CHAR
  • VARCHAR
  • GRAPHIC
  • VARGRAPHIC
  • BINARY
  • VARBINARY

The result is a string that is the same data type as the input string, in varying format.

length

Specifies the length of the result

The value must be a positive integer value in either a constant or an expression form.

The value cannot be larger than the maximum length of the input string.

The length value is implicitly expressed in the same units as the input string. For example, if the input string is a GRAPHIC type (double-byte character string) and length has a value of 2, the total number of bytes in the result is 4. 

If the current length of the input string is less than the length value, the result string is effectively padded on the right. The string is padded with the necessary number of padding characters, and in the same encoding scheme as the input string.


Important

If any argument can be null, the result can be null; if any argument value is null, the result is the null value.





 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*