Hi All,
I tried to call the Predictive Analytics Procedure "PAL_LINEAR_REGRESSION" in xsjs,
and below is my code:
function LR()
{
try
{ var in1 = '"'+"PS_DATA"+'".'+'"'+"GROSSMARGIN1"+'"';
var in2 = '"'+"PS_DATA"+'".'+'"'+"PAL_CONTROL_TBL"+'"';
var output1 = [];
var conn1 = $.hdb.getConnection();
var fn = conn1.loadProcedure("_SYS_AFL","PAL_LINEAR_REGRESSION");
var fnResult = fn(in1,in2);;
conn1.commit();
conn1.close();
output1.push(fnResult);
} catch(e) {
$.response.setBody(e.toString()); }
}
$.response.setBody(JSON.stringify(LR()));
//where I'm getting error as,
InternalError: dberror($.hdb.Connection.executeProcedure): 8 - SQL error, server error code: 8. invalid argument: Input parameter is inadequate as table parameter: line 1 col 47 (at pos 46) at ptime/query/checker/check_call.cc:1849
But if I run the same procedure in console it is giving the proper output, for the sql call,
call "_SYS_AFL"."PAL_LINEAR_REGRESSION"("PS_DATA"."GROSSMARGIN1","PS_DATA"."PAL_CONTROL_TBL",?,?,?,?,?),
Can someone please help me out in this regard.
Thanks in Advance,
Medini H K
Request clarification before answering.
In the interface of the created function representing the DB procedure a table is expected and not just a table name as it is accepted in SQL/SQLScript. You can overcome that issue by creating a wrapper procedure which calls the PAL procedure. In your XSJS coding than you can call the wrapper procedure.
Regards,
Florian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.