Skip to Content

How to call a calculation view with input parameters in XSJS


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.



Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on 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$$'," .....



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.