Re: [Sedna-discussion] check to exist collection and create it
Sedna is a native full-featured XML database management system.
Brought to you by:
mozinsur,
shcheklein
From: Adrian I. <adr...@gm...> - 2008-03-22 17:33:32
|
Hi, I don’t think that Create Collection is part of XQuery… Try from your program to send 2 queries… first count and then try to create the collection: count(fn:doc("$collections")/collections/collection[@name = "_MyCollectionName"]) Thanks Adrian From: sed...@li... [mailto:sed...@li...] On Behalf Of ??????? ??????? Sent: Saturday, March 22, 2008 7:07 PM To: sed...@li... Subject: [Sedna-discussion] check to exist collection and create it Hello. Need to check of exist collection and if not exist create it. My example, get error: let $c := fn:doc("$collections")/collections/collection[@name = "_MyCollectionName"]/data(@name) return if ($c) then CREATE COLLECTION "_MyCollectionName" else "" Warning: SEDNA Message: ERROR XPST0003 It is a static error if an expression is not a valid instance of the grammar defined in A.1 EBNF. Details: syntax error at token: 'COLLECTION' Thx, Vitaliy |