cancel
Showing results for 
Search instead for 
Did you mean: 

How to write XSJS Select Query with input parameters

Former Member
0 Kudos

Hello Experts,

I am creating a xsjs file and in that file I am trying to write a Select Query based on a Calculation View

I have tried it the following way:

var query = 'SELECT TOP 100 \"Name\", \"Address\", \"City\", \"Country\" FROM \"_SYS_BIC\".\"Test.HL/AddressView\"'

    + 'WITH PARAMETERS(\'PLACEHOLDER\' = (\'$$P_Name$$\', \' Akhil \'),'

  + '\'PLACEHOLDER\' = (\'$$P_City$$\', \' Lucknow \'))';

But it gives me the "Mixed spaces and tabs error".

How should I write XSJS Select Query with input parameters?

Regards,

Rohit

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>But it gives me the "Mixed spaces and tabs error".

Mixed spaces and tabs has nothing to do with the syntax of the statement. You used both spaces and the tab in the content - which JSLint doesn't like.  Remove the beginning spaces of each line and use only one or the other.

The actual syntax of your statement doesn't look right.  The problem is that you are escaping the \ when you don't need to if you are using ' instead of " for your string.  You escape with \" in the first line but then escape with \' in the 2nd and 3rd line.  That is going to cause serious parsing problems with the command.

Answers (0)