Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 17 » SQL Anywhere Server - SQL Reference » SQL functions » Functions

DB_NAME function [System]

Returns the name of a database with a given ID number.

Syntax
DB_NAME( [ database-id ] )
Parameters
  • database-id

    The ID of the database. The database-id must be a numeric expression.

Returns

VARCHAR

Remarks

If no database ID is supplied, the name of the current database is returned.

Privileges

No privileges are required to execute this function for the current database. To execute this function for other databases, you must have either the SERVER OPERATOR or MONITOR system privilege.

Standards
  • ANSI/ISO SQL Standard

    Not in the standard.

Example

The following statement returns the database name demo when executed against the sample database as the sole database on the server:

SELECT DB_NAME( 0 );