Returns the next database ID number, or the first database if the parameter is NULL.
NEXT_DATABASE ( { NULL | database-id } )
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-id An integer that specifies the ID number of the database.
The following statement returns the value 0, the first database value:
SELECT NEXT_DATABASE( NULL ) FROM iq_dummy
The following statement returns NULL, indicating that there are no more databases on the server:
SELECT NEXT_DATABASE( 0 ) FROM iq_dummy
You can use NEXT_DATABASE to enumerate the databases running on a database server. To get the first database, pass NULL; to get each subsequent database, pass the previous return value. The function returns NULL when there are no more databases.