Hi Dirk,
Thanks for the answer!
When creating the database, I do not know what the root of the document to create will be.
Also, I do not have any physical documents (xml files) to add initially as the root elements will be created programmatically (basex embedded mode).
the db:add() command needs an initial input: Is there a way to create an empty document?

Thanks.

2016-10-06 18:29 GMT+02:00 Dirk Kirsten <dk@basex.org>:
Hello Erdal,

a database consists of (multiple) documents. When you create a database
with the given command it will be en empty database without any
document. So to write into it you will have to add at least one document
first, e.g. by using the ADD command
(http://docs.basex.org/wiki/Commands#ADD) or db:add()
(http://docs.basex.org/wiki/Database_Module#db:add)

Cheers
Dirk

On 10/06/2016 06:03 PM, Erdal Karaca wrote:
> Hi,
> When creating an empty database, then trying to insert a node into its
> root, I get the following error message:
>
> Command:
> create db test
>
> XQuery:
> insert node <test></test> into /
>
> Error:
> [XUDY0027] Insert target is an empty sequence.
>
> How can I populate an empty database? - I am using basex 8.5.3.
>
> Thanks!

--
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22