# setDefaultCatalog {#setDefaultCatalog}

## Syntax {#Syntax .section}

`setDefaultCatalog(catalog)`

## Arguments {#Arguments .section}

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

## Details {#Details .section}

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 {#Examples .section}

``` {#codeblock_pvr_4cb_pbc}
createCatalog("cat1")
setDefaultCatalog("cat1")
getCurrentCatalog()
// output: cat1

setDefaultCatalog("")
getCurrentCatalog()
// NULL
```

**Parent topic:**[Functions](../../Functions/category.md)

