|-
| valign='top' | '''Errors'''
|<b>[[XQuery Errors#BaseX Errors (BASX)|BASX0003]]</b> is raised if the database is not found.
|-
| valign='top' | '''Examples'''
|-
| valign='top' | '''Errors'''
|<b>[[XQuery Errors#BaseX Errors (BASX)|BASX0004]]</b> is raised if the specified <code>$pre</code> value does not exist in the database.
|-
| valign='top' | '''Examples'''
|-
| valign='top' | '''Errors'''
|<b>[[XQuery Errors#BaseX Errors (BASX)|BASX0004]]</b> is raised if the specified <code>$id</code> does not exist in the database.
|}
|-
| valign='top' | '''Errors'''
|<b>[[XQuery Errors#BaseX Errors (BASX)|BASX0001]]</b> is raised if the index is not available.
|-
| valign='top' | '''Examples'''
|-
| valign='top' | '''Errors'''
|<b>[[XQuery Errors#BaseX Errors (BASX)|BASX0001]]</b> is raised if the specified index is not available.
|-
| valign='top' | '''Examples'''
|-
| valign='top' | '''Errors'''
|<b>[[XQuery Errors#BaseX Errors (BASX)|BASX0002]]</b> is raised if <code>$db</code> is not a database node.<br/><b>[[XQuery Errors#BaseX Errors (BASX)|BASX0003]]</b> is raised if <code>$db</code> is a string and a database with that name cannot be open.<br/><b>[[XQuery Errors#Functions Errors (FOAR, FOCA, FOCH, FODC, FODF, FODT, FOER, FOFD, FONS, FORG, FORX)|FODC0002]]</b> is raised if <code>$input</code> is a string representing a path, which cannot be read.<br/><b>[[XQuery Errors#Update Errors (FOUP, XUDY, XUST, XUTY)|FOUP0001]]</b> is raised if <code>$input</code> is not a string and not a document node.
|-
| valign='top' | '''Examples'''
|-
| valign='top' | '''Errors'''
|<b>[[XQuery Errors#BaseX Errors (BASX)|BASX0002]]</b> is raised if <code>$db</code> is not a database node.<br/><b>[[XQuery Errors#BaseX Errors (BASX)|BASX0003]]</b> is raised if <code>$db</code> is a string and a database with that name cannot be open.<br/><b>[[XQuery Errors#BaseX Errors (BASX)|BASX0012]]</b> is raised if <code>$path</code> is not a single document path.<br/><b>[[XQuery Errors#Functions Errors (FOAR, FOCA, FOCH, FODC, FODF, FODT, FOER, FOFD, FONS, FORG, FORX)|FODC0002]]</b> is raised if <code>$input</code> is a string representing a path, which cannot be read.<br/><b>[[XQuery Errors#Update Errors (FOUP, XUDY, XUST, XUTY)|FOUP0001]]</b> is raised if <code>$input</code> is not a string and not a document node.
|-
| valign='top' | '''Examples'''
|-
| valign='top' | '''Errors'''
|<b>[[XQuery Errors#BaseX Errors (BASX)|BASX0002]]</b> is raised if <code>$db</code> is not a database node.<br/><b>[[XQuery Errors#BaseX Errors (BASX)|BASX0003]]</b> is raised if <code>$db</code> is a string and a database with that name cannot be open.
|-
| valign='top' | '''Examples'''
|-
| valign='top' | '''Errors'''
|<b>[[XQuery Errors#BaseX Errors (BASX)|BASX0002]]</b> is raised if <code>$db</code> is not a database node.<br/><b>[[XQuery Errors#BaseX Errors (BASX)|BASX0003]]</b> is raised if <code>$db</code> is a string and a database with that name cannot be open.<br/><b>[[XQuery Errors#BaseX Errors (BASX)|BASX0013]]</b> is raised if new document name(s) will be empty.
|-
| valign='top' | '''Examples'''
|-
| valign='top' | '''Errors'''
|<b>[[XQuery Errors#BaseX Errors (BASX)|BASX0002]]</b> is raised if <code>$db</code> is not a database node.<br/><b>[[XQuery Errors#BaseX Errors (BASX)|BASX0003]]</b> is raised if <code>$db</code> is a string and a database with that name cannot be open.<br/><b>[[XQuery Errors#BaseX Errors (BASX)|BASX0014]]</b> is raised if an error occurs during optimizing the data structures.<br/><b>[[XQuery Errors#BaseX Errors (BASX)|BASX0015]]</b> is raised if the <code>$all</code> flag is set to <code>true()</code>, but the database is an in-memory database.<br/><b>[[XQuery Errors#BaseX Errors (BASX)|BASX0016]]</b> is raised if the database <code>$db</code> is in use by other user(s).
|-
| valign='top' | '''Examples'''