Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

Use XSJS-service parameter for SELECT ... WHERE... IN(...) clause

$
0
0

Hello,

 

I need to create XSJS-service which will make search using a next clause

 

SELECT C1, C2 FROM T1 WHERE C2 IN ('01', '02')

 

, where search string '01', '02' will be a url parameter:

 

service call url:

 

http://server/service.xsjs&query=01,02

 

Simple service text:

//get search string from url parameter

var search = $.request.parameters.get('query');

 

var conn = $.db.getConnection();

query = "SELECT C1, C2 FROM T1 WHERE C2 IN (?)"

 

pstmt = conn.prepareStatement(query);

pstmt.setString(1, search);

 

rs = pstmt.executeQuery();

 

Unfortunately, setString method assign search string as a one big string '01,02', and select doesn't return any data.

 

How I can assign a list of values to query parameter? Any ideas?


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>