January 7th, 2009

UPPER (chg. to upper case)

The UPPER function changes all characters to lower case. Case changes affect only letters. Spaces, numbers, special characters, and punctuation remain unchanged.
Format: UPPER(string)

Example:           UPPER('What is THAT?')

Result: ‘WHAT IS THAT?’

> Access does not support UPPER. Instead it uses UCASE.

> DB2 and MySQL support UPPER as well as UCASE.

> Oracle, PostgreSQL, and SQL Server support UPPER.

January 6th, 2009

TRIM (remove lead or trail chars.)

The TRIM function removes leading characters, trailing characters, or both from a character string or BLOB value.
If a removal character is not specified, spaces are removed by default. TRIM will not remove characters within a string. The COLLATE clause forces the result set into another pre-existing collating sequence.

Format:

TRIM([[{LEADING|TRAILING BOTH}] [remove_char] FROM source_string [COLLATE name])

Example:

TRIM(LEADING 'My name is ' FROM 'My name is William Diamond') Result: 'William Diamond'
TRIM(BOTH '---' FROM '---One Thousand Dollars---') Result: 'One Thousand Dollars'
TRIM(TRAILING 'Dollars---' FROM '---One Thousand Dollars---') Result: '---One Thousand '

 

> MySQL, Oracle, and PostgreSQL support TRIM.

> The Access functions, TRIM(string), LTRIM(string), and RTRIM(string) are non-standard according to
ANSI standards.

> DB2 and SQL Server do not support TRIM. Instead they have LTRIM(string) and RTRIM(string).

> Oracle and PostgreSQL also have LPAD and RPAD to add spaces.

January 5th, 2009

TRANSLATE (chg. character set)

The TRANSLATE function changes the representation of a character string from one base character set to another character set and collation.

Format: TRANSLATE(value, USING translation_char_name)

> Access does not support TRANSLATE.

> DB2 does not support the TRANSLATE standard. It has TRANSLATE(source, replacement, match).

> MySQL does not support TRANSLATE. Instead, it uses the CONV function.

> Oracle supports the TRANSLATE standard, but it can only convert between the database character set and the national language character set.

> PostgreSQL does not support TRANSLATE. Instead, it uses its own non-standard TRANSLATE function.

> SQL Server does not support TRANSLATE. Instead, it uses its own non-standard CONVERT function.

Next Page »