SYSDATE in combination with Views and Analytic Functions causes Error

Details

Detail name Value
Changelog Number 9418
Type Bug
Status Resolved
Affected Versions Exasol 6.2.0
Fix Versions Exasol 7.0.0, Exasol 6.2.5
Resolution Date 2020-01-28

Problem

If an expression (e.g. '||') combines analytic functions with a column from a view and if this column is based on SYSDATE, Exasol throws an Error.

Example:

CREATE OR REPLACE VIEW v1 AS
SELECT SYSDATE AS CURRENT_YEAR FROM dual;

SELECT CURRENT_YEAR || MIN(1) OVER () FROM v1;

Workaround

Cast the column (CURRENT_YEAR in the example) to the appropriate type (e.g., varchar).

Example:

CREATE OR REPLACE VIEW v1 AS
SELECT SYSDATE AS CURRENT_YEAR FROM dual;

SELECT to_char(CURRENT_YEAR) || MIN(1) OVER () FROM v1;