Thursday, June 4, 2020

#772 - OIC --> Date Manipulation

*** This post is more a note for myself, but others may find it useful ***

Simple scenario here -

I have a scheduled job that picks up orders from an eCommerce site.
The getOrders invoke expects 2 parameters - dateFrom and dateTo.

Business rule from customer is -
dateFrom = currentDateTime - 1 day
dateTo = currentDateTime.

So how do we set the dateFrom value?

Simple when you know how - thanks to my colleague Kishore K. here.











currentDateTime is easy.

But what about dateFrom?

I can leverage the following in JDeveloper -

















but what about OIC?
The above function is not available but I could try xs:dayTimeDuration
e.g. current-dateTime() - xs:dayTimeDuration('P1D')

So I try this out -


















So much for that - now I take a look at the Code view in the Mapper.












So I make this subtle change and it works -









The output is as follows -







However, I need the format - 2020-06-03T12:26:15

So how can I strip off the .109Z ?

Easy -








Result -







No comments:

Post a Comment