on 02-27-2019 10:23 AM
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
User | Count |
---|---|
74 | |
9 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.