The NEXT_DATABASE function is used to enumerate the databases running on a database server. To get the first database specify
NULL; to get each subsequent database, specify the previous return value. The function returns NULL when there are no more
databases. The database ID numbers are not returned in a particular order, but you can tell the order in which databases were
started on the server using the database ID. The first database started on the server is assigned the value 0, and for subsequent
databases started on the server, the database IDs are incremented by 1.
Cloud note: Because of tenant database isolation rules, when this function is called in the cloud it returns only information about the
current tenant database.