An incorrect query might be pushed down to the database, which results in an error when the following are true:
The error that occurs vary depending on the underlying database that you are connecting to. Some of the errors that occur include the following:
ERROR: CLI open cursor error: ERROR: Error in select view conditions: Unable to execute condition using types 'localdate' and 'long'.java.sql.SQLException: Error in select view conditions: Unable to execute condition using types 'localdate' and 'long'.;Error while executing the query
ERROR: CLI prepare error: [SAP AG][LIBODBCHDB SO][HDBODBC] General error;266 inconsistent datatype: DATE type is not comparable with INT type.: line 1 col 94 (at pos 93)
ERROR: ORACLE prepare error: ORA-00932: inconsistent datatypes: expected NUMBER got DATE.
Instead of passing the interval as entered in the code, the interval changes to the data type of the input columns to the function.
For example, if the query included NumDaysBetween(date1,date2)=1, the 1 would be passed as the equivalent of 02JAN1960. In addition, if date1 and date2 were datetimes, the 1 would be passed as the equivalent of 01JAN1960:00:00:01.
The workarounds for this issue include the following: