1.1

Table Of Contents
Example
To return the string aSD1#w in uppercase, use the following clause:
VALUES UPPER('aSD1#w')
The value returned is ASD1#W.
USER function
When used outside stored routines, USER, CURRENT_USER function on page 555, and SESSION_USER
function on page 566 all return the authorization identier of the user that created the SQL session.
SESSION_USER also always returns this value when used within stored routines.
If used within a stored routine created with EXTERNAL SECURITY DEFINER, however, USER and
CURRENT_USER return the authorization identier of the user that owns the schema of the routine. This is
usually the creating user, although the database owner could be the creator as well.
For information about dener's and invoker's rights, see CREATE PROCEDURE on page 473 or CREATE
FUNCTION on page 467.
Syntax
USER
Example
VALUES USER
VARCHAR function
The VARCHAR function returns a varying-length character string representation of a character string.
Character to varchar syntax
VARCHAR (CharacterStringExpression )
An expression whose value must be of a character-string data type with
a maximum length of 32,672 bytes.
CharacterStringExpression
Datetime to varchar syntax
VARCHAR (DatetimeExpression )
An expression whose value must be of a date, time, or timestamp data
type.
DatetimeExpression
Example
Using the EMPLOYEE table, select the job description (JOB dened as CHAR(8)) for
Dolores Quintana as a VARCHAR equivelant:
SELECT VARCHAR(JOB)
FROM EMPLOYEE
WHERE LASTNAME = 'QUINTANA'
573
SQL Language Reference