Skip to Content
0

XSJS Select Issue

Feb 22, 2017 at 11:09 AM

80

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Thomas Jung
Mar 01, 2017 at 08:40 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded