SQL iQuery Script Built-in Functions

Trim Characters from Right Side

trimRight

The trimRight() built-in functions returns the value specified on the first parameter with the characters specified on the 2nd parameter removed from the Right side of the value.

Syntax

The timeRight built-in function returns the contents of the first parameter after removing all characters specified on parameter 2 or blanks if no parameter 2 is specified. Use this built-in function to truncate the right side of the contents in a Session variable.

Parameters

  1. Variable or quoted character string whose content is trimmed.
  2. A list of characters to be removed from the Right side of the value in parameter 1. If this parameter is omitted, blanks are trimmed.
eval &partNbr = 'THX1138';
eval &Vendor = trimRight(&partNbr, ' 0123456789');
#msg The Vendor code for &PARTNBR is "&Vendor"

The output written to the joblog is:

The Vendor code for THX1138 is "THX"