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

SQL Anywhere 11.0.1 (Français) » SQL Anywhere Server - SQL Reference » Using SQL » SQL functions » SQL functions (A-D)

 

DB_ID function [System]

Returns the database ID number.

Syntax
DB_ID( [ database-name ] )
Parameters
  • database-name   A string containing the database name. If no database-name is supplied, the ID number of the current database is returned.

Returns

INT

See also
Standards and compatibility
  • SQL/2003   Vendor extension.

Example

The statement returns the value 0, when executed against the SQL Anywhere sample database as the sole database on the server.

SELECT DB_ID( 'demo' );

The following statement returns the value 0 if executed against the only running database.

SELECT DB_ID( );