Skip to Content

XSJS Select Issue

Hi All,

I am writing a select in XSJS service.

SELECT EVENTID

FROM VALUE_FACT.VF_LOSS_DB

WHERE TO_CHAR(DATE_FROM,'YYYY-MM-DD')=(SELECT MAX(TO_CHAR(DATE_FROM,'YYYY-MM-DD')) FROM VALUE_FACT.VF_LOSS_DB) ORDER BY DATE_FROM ASC

The above select is working fine when am trying to execute in SQL Console .

But if i write the same select in xsjs service it is throwing error.

Error is dberror(Connection.prepareStatement): 260 - invalid column name: YYYY: line 1 col 233 (at pos 232).

Could any body please help me how to rewrite this query to work in xsjs.

Regards,

Shekar

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Mar 01, 2017 at 08:40 PM

    Maybe you aren't escaping the single quote correctly for JavaScript. Can you post your actual XSJS coding?

    Add comment
    10|10000 characters needed characters exceeded