Skip to Content
0

How to call a calculation view with input parameters in XSJS

Oct 13, 2016 at 09:39 AM

321

avatar image

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

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

1 Answer

Best Answer
Leonhard Hellwich Dec 23, 2016 at 11:28 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded