cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to pass the parameters from XSJOB to XSJS

0 Kudos

We are calling a procedure in XSJS, procedure has input parameters.

and we have a XSJOB to the XSJS to schedule the procedure every day.

Defined the parameters in XSJOB definition and having difficulty in reading the parameters with in xsjs. Can you please guide how to read those parameters in the xsjs and pass it to procedure.

code snippet for xsjob

{ "description": "Move Data DT", "action": "development.srini.ERS_TO_DT:ers_move_to_dt.xsjs::runFg", "schedules": [ { "description": "Move Data DT", "xscron": "* * * * 01 30 00", "parameter": { "p_start": "" , "p_end": "", "p_schema": "", "p_table": "" } } ] }

code snippet for XSJS

function runFg(input) { var p_start = input.p_start; var p_end = input.p_end; var p_schema = input.p_schema; var p_table = input.p_table; try{ var connection = $.hdb.getConnection(); var query = connection.loadProcedure('MANDAS', 'development.srini::SP_MOVE_TO_DT'); //pass value for input parameter var result = query(p_start,p_end,p_schema,p_table); connection.commit(); connection.close(); } //catch exception catch (e) { } }

THanks

Srini

pfefferf
Active Contributor
0 Kudos

The xsjob and the xsjs coding to pass the parameters to the procedure looks fine. How do you see that it does not work, do you get any errors in your job runs or something else?

0 Kudos

I was not passing the parameters correctly between xsjob and xsjs. type mistake.

Thank you for your help

Accepted Solutions (0)

Answers (0)