How to retrieve same name resource
Friday, 1 June 2012 · 5 messages
AB
Anupam Bakshi1 Jun 2012 11:31 #
Hello all,
I have two resources at the same path in a database.
XQUERY
db:list("project1")
Returns :
resultset1.xml
resultset1.xml
The two resources have different contents.
However, when I do the following, I get the XML content from the first file.
XQUERY db:open("project1", "resultset1.xml")
What is the way to get the second XML file?
Thanks for your help.
AnupamAB
Anupam Bakshi1 Jun 2012 13:44 #
Correction:
XQUERY db:open("project1", "resultset1.xml")
returns contents from not the first one but all files.
But the question remains, if there are two resources at the same path in a database, how to retrieve a specific resource.
Is it even possible?
Thanks,
Anupam
AB
AB
Anupam Bakshi1 Jun 2012 16:44 #
Hello all,
I've gone thru the documentation but I can't find a way to delete one of many resources located at the same path in a database.
So if I have :
% list project1
sample1.xml
sample1.xml
Following command deletes both resources at the specified path. % delete sample1.xml
Is there a way to delete a specific resource, not all of them?
Thanks,
Anupam
P.S. If you care to know why I need this - it is because I'm getting XML data on a frequent basis that will be stored in the database. Xquery will go in and consolidate the data based on the last few files. I will also need to purge older files. I'm trying to figure out a way to do this. If someone can recommend a better plan of how this might work, I would appreciate it.
DP
Dimitar Popov1 Jun 2012 19:26 #
Quoted text · 05:44:46 · 14 lines
Am Freitag, 1. Juni 2012, 05:44:46 schrieb Anupam Bakshi: > Hello all, > I've gone thru the documentation but I can't find a way to delete one of > many resources located at the same path in a database. > So if I have : > > % list project1 > sample1.xml > sample1.xml > > Following command deletes both resources at the specified path. > % delete sample1.xml > > Is there a way to delete a specific resource, not all of them?
Which one of them would you like to delete?
Regards,
Dimitar
Written for BaseX 7.2. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery