SUSER_NAME Function [System]

Returns the user name.

Syntax

SUSER_NAME ( [ user-id ] )

Parameters

Parameter

Description

user-id

The user identification number.

Returns

LONG VARCHAR

Note: The result data type is a LONG VARCHAR. If you use SUSER_NAME in a SELECT INTO statement, you must have an Unstructured Data Analytics Option license or use CAST and set SUSER_NAME to the correct data type and size.

Examples

The following statement returns the value DBA:

SELECT SUSER_NAME ( 1 ) FROM iq_dummy

The following statement returns the value SYS:

SELECT SUSER_NAME ( 0 ) FROM iq_dummy

Standards and Compatibility

  • SQL—Vendor extension to ISO/ANSI SQL grammar.

  • Sybase—Adaptive Server Enterprise function implemented for SAP Sybase IQ. In Adaptive Server Enterprise, SUSER_NAME returns the server user name.

Related reference
SUSER_ID Function [System]
USER_ID Function [System]
USER_NAME Function [System]