DB_ID function [System]

Function

Returns the database ID number.

Syntax

DB_ID ( [ database-name ] )

Parameters

database-name A string expression containing the database name. If database-name is a string constant, it must be enclosed in quotes. If no database-name is supplied, the ID number of the current database is returned.

Examples

The following statement returns the value 0, if asiqdemo is the only running database:

SELECT DB_ID( 'asiqdemo' ) FROM iq_dummy

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

SELECT DB_ID() FROM iq_dummy

Standards and compatibility

See also

“DB_NAME function [System]”

“OBJECT_ID function [System]”