Problem in insret clause...

Hello!

I have 2 collections, one empty (artvalid) and the other one with some documents (artarchive). The documents in both collections are from the same schema and i want to copy all document with the appropriate year value from artarchive to artvalid, but no documents are copied with this query:

update insert
for $art in collection('artarchive')/article
where $art/date1/year='2005' or $art/date2/year='2005'
return $art
into collection('artvalid')

Can u help me?

Nathaire

You’ve checked that the subquery

for $art in collection('artarchive')/article 
where $art/date1/year='2005' or $art/date2/year='2005' 
return $art 

does indeed return the documents you want to copy?

Hi,

Unfortunately it is not possible to copy documents via XQuery update. It is also not possible to insert new documents into a given collection.

Best Regards,

Thorsten Fiebig

First of all, yes, the subquery return the wanted result.

But if I understand correctly the second reply, it’s impossible to insert new documents by xQuery?

How can I do this if I have more than 1000 documents?

Tks for reply

Nathaire

Use the Tamino Data Loader utility. See the Tamino documentation under “Using Tamino”, “TaminoData Loader”