Hi Santhosh, In XML databases there is no such thing as tables and record fields, so there is no such thing as a autonumber field concept. But there are other concepts that can be used to 'uniquely' identify content. Most importently, each document in the database has a uri, with which you access it. But there is also the concept of directories in MarkLogic, and more generally in Xquery the concept of collections. These both help to group documents.
It is possible to use a directory property to keep track of uniquely generated id's. Just create a function that retrieves the property, increments the value, and returns a uri with the directory uri as base and the sequence number appended to it. Use the functions xdmp:document-properties and xdmp:document-set-property for this purpose. The code will not likely be portable though. Kind regards, Geert > Drs. G.P.H. Josten Consultant http://www.daidalos.nl/ Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 http://www.daidalos.nl/ KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. > From: [email protected] > [mailto:[email protected]] On Behalf Of > Santhosh Raj > Sent: dinsdag 5 mei 2009 14:19 > To: General Mark Logic Developer Discussion > Subject: [MarkLogic Dev General] In oracle we can create > sequence to generate a unique key(used as primary key) , Is > there any function in Marklogic to create a unique id - reg., > > > HI all, > > In oracle we can create sequence to generate a unique > key(used as primary key) , Is there any function in Marklogic > to create a unique id(sequence of unique id's) . > > Thanks and Regards, > Santhosh Rajasekaran > > =====-----=====-----===== > Notice: The information contained in this e-mail message > and/or attachments to it may contain confidential or > privileged information. If you are not the intended > recipient, any dissemination, use, review, distribution, > printing or copying of the information contained in this > e-mail message and/or attachments to it are strictly > prohibited. If you have received this communication in error, > please notify us by reply e-mail or telephone and immediately > and permanently delete the message and any attachments. Thank you > > > _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
