Skip to Content

How to call a calculation view with input parameters in XSJS

Hi,

I have a requirement where I have to fetch data from a calculation view with multiple parameters using XSJS. Following code gets activated however upon calling the url I get a 500(Forbidden error) and the traces show me that the very first parameter in the select has some issue which it does not describe.

var pstmt =conn.prepareStatement("SELECT * FROM \"_SYS_BIC\".\"TABLE NAME\" (\'PLACEHOLDER\'=(\'$$iv_param1$$\',"+ iv_param1 +"),(\'$$iv_param2$$\'," + iv_param2 + "),(\'$$iv_param3$$\'," + iv_param3 + "),(\'$$iv_param4$$\'," + iv_param4 + "),");

Any help is highly appreciated.

Thanks

Arkajeet

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Dec 23, 2016 at 11:28 AM

    Why are you escaping these: ' ?

    If you start a String in JS with this " char you have to escape only the beginning char.

    SQL-String should look like this: "SELECT * FROM \"_SYS_BIC\".\"TABLE NAME\" ('PLACEHOLDER'=('$$iv_param1$$'," .....

    BR,

    Leo

    Add comment
    10|10000 characters needed characters exceeded