setDefaultCatalog

Syntax

setDefaultCatalog(catalog)

Arguments

catalog is a string specifying the catalog name. An empty string ("") means no default catalog is used.

Details

Set a default catalog for the current session. After setting a default catalog, you can refer to databases and tables without specifying the catalog name explicitly.

Examples

createCatalog("cat1")
setDefaultCatalog("cat1")
getCurrentCatalog()
// output: cat1

setDefaultCatalog("")
getCurrentCatalog()
// NULL