Hitachi

Hitachi Advanced Database SQL Reference


6.5.1 CURRENT_USER

Returns the authorization identifier of the currently executing HADB user.

Organization of this subsection

(1) Specification format

user-information-acquisition-function-CURRENT_USER ::= CURRENT_USER

(2) Rules

  1. The data type of the execution result is the VARCHAR type.

  2. Specifying CURRENT_USER multiple times in an SQL statement produces the same value.

  3. The value of CURRENT_USER is acquired when the SQL statement is executed on the HADB server. For details about interfaces and execution methods for executing SQL statements, see the descriptions of the JDBC API, ODBC functions, and CLI functions in the HADB Application Development Guide.

  4. CURRENT_USER can be specified in places where a value specification can be specified.

(3) Example

Example

Retrieve a list of information (the contents of SQL_TABLES) about the tables owned by the current user (the HADB user whose authorization identifier is currently connected to the HADB server).

SELECT * FROM "MASTER"."SQL_TABLES"
    WHERE TABLE_SCHEMA=CURRENT_USER