Wednesday, December 25, 2024

OIC - How to add days to date YYYY-MM-DD using prebuilt functions

Use Case: 

Adding a Specific Number of Days to a Database Fetched Date in the Format YYYY-MM-DD

Logic Steps:

  1. Convert the input date (in YYYY-MM-DD format) to a date object using the date() function.
  2. Add the required number of days using the dayTimeDuration("P10D") function (e.g., for 100 days, use "P100D").
  3. Finally, convert the result back to a string using the string() function.

Solution :

string((xsd:date(/nstrgmpr:execute/ns20:request-wrapper/ns20:inputDate) + xsd:dayTimeDuration("P10D")))



No comments:

Post a Comment

Featured Post

OIC - Oracle Integration-Bulk load into Oracle ATP OR Oracle ADW

Oracle Integration enhances its database adapters, including Oracle Autonomous Transaction Processing (ATP) and Autonomous Data Warehouse (A...