on 07-24-2019 12:46 PM
Hi,
I am trying to call the stored proc from XSJS in XS Classic. This is my code:
var conn;
try {
conn = $.hdb.getConnection();
var fn = conn.loadProcedure("GUNAWF01", "ACCESS_TEST.FD.STORED_PROCEDURES::PR_050_HTS_SQL_TRAINd");
//var fnResult = fn(searchStrategy);
conn.commit();
conn.close();
$.response.setBody("Training finished.");
$.response.status = $.net.http.OK;
} catch (err) {
$.response.contentType = "text/plain";
$.response.setBody("Error while executing query: [" + err.message + "]");
$.response.returnCode = 200;
}
It looks like the stored procedure is never called. I got the message "Training Finished", but I don't see any output from the stored procedure. Not sure what is missing.
Well in the code above you have the call to the stored procedure commented out. Is that really what's in your service? If so that perfectly explains why the procedure isn't called. The loadProcedure just loads the metadata of the procedure and creates a JavaScript proxy function for it. You still have to call that function to execute the procedure.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As I said above you have the actual call commented out (the // before that line).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.