Troubleshooting: Activity saves a DateTime value in a Date property (Oracle schema issue)
Symptom
In the following activity, a property defined as a Date
type incorrectly returned a DateTime
value to the clipboard instead of a Date
value.
This activity references the following:
- A property called DueOutDate defined as a
Date
type.. - A property called DateReceived defined as a
DateTime
property. - A map value rule called GlobalSLATiming. This map value returns a value using the standard function rule @AddToDate()::
When the activity runs:
- DueOutDate is set by the GlobalSLATiming.
- GlobalSLATiming returns a value from @AddToDate to adjust DateReceived by a pre-determined number of days.
The @AddToDate() function should return a Date
value (for example, 04/17/2007), but instead it returns a DateTime
value (for example, 04/17/2007 11:04:47).
This issue also arises when reports are run using the DueOutDate as an option. DueOutDate is exposed in the database as a Date
type. When a report is run, the following error is displayed:
Customize summary criteria ** There was a problem getting a list: code: 1861 SQLState: 22008 Message: ORA-01861: literal does not match format string
This error occurs because the database returns a column type of TIMESTAMP.
Solution
Update the database schema so that every date column has a type of VARCHAR(8), never TIMESTAMP.
All Date
properties, regardless of the database software hosting your PegaRULES database, must be of the type VARCHAR(8).
Previous topic Troubleshooting: Oracle JDBC Driver 10.1.2.0 Database.Impl Error, problem opening database instance Next topic Troubleshooting: How to solve a similar-characters issue in a SQL query to an Oracle database