The arguments to the LEFT function cannot be user-defined
data types.
What the LEFT function returns depends on the number
of logical characters in source_string and on the value of position:
If source_string evaluates to a string with more than position characters,
the return value is a substring of source_string, consisting
of all characters to the left of the specified position.
If source_string evaluates to a string with no more than position characters,
the return value is the entire source_string.
If source_string evaluates to NULL, or if position is
zero or negative, then NULL is returned.
If no position argument is specified, no string value is
returned, and an exception is issued.
The return data type is the same as its source_string argument.
If a host variable is the source, the return value is either NVARCHAR
or NCHAR, according to the length of the returned string, using the
return type promotion rules that the section Return Types from the CONCAT
Function describes.
The following function expression requests the first five
characters of a quoted string:
LEFT('www.ibm.com',5)
In
this example, the LEFT function returns the substring www.i