All Products
Search
Document Center

MaxCompute:TOUPPER

Last Updated:Jul 12, 2023

Converts lowercase letters in a string specified by source into uppercase letters.

Syntax

string toupper(string <source>)

Parameters

source: required. A value of the STRING type. If the input value is of the BIGINT, DOUBLE, DECIMAL, or DATETIME type, the value is implicitly converted into a value of the STRING type before calculation. Only English characters are supported.

Return value

A value of the STRING type is returned. The return value varies based on the following rules:

  • If the value of source is not of the STRING, BIGINT, DOUBLE, DECIMAL, or DATETIME type, an error is returned.

  • If the value of source is null, null is returned.

Examples

  • Example 1: Convert lowercase letters in a string into uppercase letters. Sample statement:

    -- The return value is ABCD. 
    select toupper('aBcd');
    -- The return value is CHINA FIGHTING. 
    select toupper('China Fighting');
  • Example 2: The input parameter is set to null. Sample statement:

    -- The return value is null. 
    select toupper(null);

Related functions

TOUPPER is a string function. For more information about functions related to string searches and conversion, see String functions.