Skip to Content
1
Jul 09, 2013 at 05:10 PM

Calling Procedure from XSJS

1694 Views

Hi All,

I have two questions.

1. How to write a where condition in the below case

function test(){

var body = '';

var val1 = $.request.parameters.get('oVal1');

try {

var query =

'select \"A\", \"B\"

+ 'FROM \"amohas97.session.data::sdyn\" + where \"A\" =



var conn = $.db.getConnection();

var pstmt = conn.prepareStatement(query);

var rs = pstmt.executeQuery();

without the where condition my query works fine and it pulls/display all the records.

I am not sure how to write clause using my variable val1 in this case.

2. I have created a get_data.procedure. Now i want to use this .procedure in my .XSJS service. I want to use val1 as my importing parameter.

Any Alternatives/Suggestions.

Thanks for comments in advance.

Message was edited by: Shahid Mohammed Syed