[MarkLogic Dev General] sql:dateadd function

Geert Josten Geert.Josten at marklogic.com
Tue Jan 5 03:00:03 PST 2016


In MarkLogic 8 you can also switch your Qconsole to SQL mode, and do some SELECT on that function..

Cheers

From: <general-bounces at developer.marklogic.com<mailto:general-bounces at developer.marklogic.com>> on behalf of Javier Lizarraga <jlizarraga at gennet.com<mailto:jlizarraga at gennet.com>>
Reply-To: MarkLogic Developer Discussion <general at developer.marklogic.com<mailto:general at developer.marklogic.com>>
Date: Tuesday, December 29, 2015 at 11:12 PM
To: MarkLogic Developer Discussion <general at developer.marklogic.com<mailto:general at developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] sql:dateadd function

Great… Thanks Rob.

From: general-bounces at developer.marklogic.com<mailto:general-bounces at developer.marklogic.com> [mailto:general-bounces at developer.marklogic.com] On Behalf Of Rob Szkutak
Sent: Tuesday, December 29, 2015 2:09 PM
To: MarkLogic Developer Discussion <general at developer.marklogic.com<mailto:general at developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] sql:dateadd function

Hi,

Per the documentation, "This function is only available for use within SQL; it is not available directly from XQuery, XSLT, or JavaScript." - https://docs.marklogic.com/sql:dateadd

The equivalent operation to your example in xQuery is:

xs:dateTime('2008-11-11T13:23:44.657') + xs:dayTimeDuration('P45D')

Best,
Rob

Rob Szkutak
Associate Consultant
MarkLogic Corporation
rob.szkutak at marklogic.com<mailto:rob.szkutak at marklogic.com>
Cell +1.716.562.8464
www.marklogic.com<http://www.marklogic.com>

________________________________
From:general-bounces at developer.marklogic.com<mailto:general-bounces at developer.marklogic.com> [general-bounces at developer.marklogic.com<mailto:general-bounces at developer.marklogic.com>] on behalf of Javier Lizarraga [jlizarraga at gennet.com<mailto:jlizarraga at gennet.com>]
Sent: Tuesday, December 29, 2015 4:00 PM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] sql:dateadd function
Hi All,

I have a use case where I need to add a  day to a given dateTime variable.  I would like to use the sql:dateadd function to do this.
However, when I try to run it in Query Console I get an error:
[1.0-ml] XDMP-UNDFUN: (err:XPST0017) Undefined function sql:dateadd()
Here is the code I am running in Query Console.

xquery version "1.0-ml";
declare namespace html = "http://www.w3.org/1999/xhtml";
declare namespace sql = "http://marklogic.com/xdmp/sql";

sql:dateadd('day',45, '2008-11-11T13:23:44.657')

It’s not finding the function, but I am not clear on how to reference it.

Thanks,

Javier


Disclaimer

The information contained in this communication from the sender is confidential. It is intended solely for use by the recipient and others authorized to receive it. If you are not the recipient, you are hereby notified that any disclosure, copying, distribution or taking action in relation of the contents of this information is strictly prohibited and may be unlawful.

This email has been scanned for viruses and malware, and may have been automatically archived by Mimecast Ltd, an innovator in Software as a Service (SaaS) for business. Providing a safer and more useful place for your human generated data. Specializing in; Security, archiving and compliance. To find out more Click Here<http://www.mimecast.com/products/>.



Disclaimer

The information contained in this communication from the sender is confidential. It is intended solely for use by the recipient and others authorized to receive it. If you are not the recipient, you are hereby notified that any disclosure, copying, distribution or taking action in relation of the contents of this information is strictly prohibited and may be unlawful.

This email has been scanned for viruses and malware, and may have been automatically archived by Mimecast Ltd, an innovator in Software as a Service (SaaS) for business. Providing a safer and more useful place for your human generated data. Specializing in; Security, archiving and compliance. To find out more Click Here<http://www.mimecast.com/products/>.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20160105/c62e381b/attachment-0001.html 


More information about the General mailing list