Product Documentation

SQL Reference Guide

Previous Topic

Next Topic

SUSER_NAME function (extension)

Syntax

SUSER_NAME ( [user_id] )

Description

The scalar function SUSER_NAME returns the user login name for the user_id specified in the input argument. If no user_id is specified, SUSER_NAME returns the name of the current user.

This function provides compatibility with the Sybase SQL Server function suser_name. It is identical to the USER_NAME function.

Example

select suser_name() from admin.syscalctable;

SUSER_NAME

----------

searle

1 record selected

select suser_name(104) from admin.syscalctable;

SUSER_NAME(104)

---------------

dbp

1 record selected

select id, tbl, owner from admin.systables

1 where owner = suser_name();

ID TBL OWNER

-- --- -----

41 test searle

42 t2 searle

43 t1 searle

3 records selected

TOCIndex