mysqldbeaverrapidsqldenodo

QUERY [VIRTUAL] [ERROR] in DBeaver while querying the table in Denodo


I ran this query in DBeaver

SELECT DLY.badge_nbr,
DLY.DIM_DT_ID,attribute_type
FROM FACT_MDM_DAILY_INT DLY 
WHERE SCENARIO_TYPE = 'VOLTAGE'
AND ATTRIBUTE_TYPE = 'Phase_A_Average_RMS_Voltage'
AND DLY.dim_dt_id >= TO_DATE('2016-01-28','yyyy-mm-dd');

I get the error as QUERY [VIRTUAL] [ERROR]. Interestingly when I run the same query without date comparison in WHERE clause it works fine.

SELECT DLY.badge_nbr,
DLY.DIM_DT_ID,attribute_type
FROM FACT_MDM_DAILY_INT DLY
WHERE SCENARIO_TYPE = 'VOLTAGE'
AND ATTRIBUTE_TYPE = 'Phase_A_Average_RMS_Voltage';

Solution

  • The to_date() function in Denodo must have at least 2 parameters:

    1. The date format of your string field (look at java SimpleDateFormat)
    2. The string you want to convert to a date.

    Thus, your parameters appear to be transposed, and you must use a capital M for month... since lower case m means minutes.

    to_date('yyyy-MM-dd','2016-01-28')