Returns the database ID number.
DB_ID ( [ database-name ] )
CIS functional compensation performance considerations apply. See “Conditions that cause processing by SQL Anywhere” in Chapter 3, “Optimizing Queries and Deletions,” in the Performance and Tuning Guide.
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.
The following statement returns the value 0, if iqdemo is the only running database:
SELECT DB_ID( 'iqdemo' ) FROM iq_dummy
The following statement returns the value 0, if executed against the only running database:
SELECT DB_ID() FROM iq_dummy