I am using ROC era system as my date format (ex. 1031120 represents 20141120).
If I would like to create an Oracle function to do add days just like the Oracle build-in function ADD_MONTHS.
Here is my tailor-made Oracle function.
ADD_DAYS returns the date date plus integer days.
- The MINGUO_YYYMMDD argument only accept ROC era system as date format, ex. 1031120.
- The integer argument, DAYS, can be an integer or any value that can be implicitly converted to an integer.
- The return type is always VARCHAR2 with ROC era system as date format.
- If date is the last day of the month or if the resulting month has fewer days than the day component of date, then the result is the last day of the resulting month. Otherwise, the result has the same day component as date.
Add 5 days
Subtract 3 days