cancel
Showing results for 
Search instead for 
Did you mean: 

"Input Parameter is Inadequate as Table Parameter" error while calling PAL_LINEAR_REGRESSION in xsjs

08-16-2018 12:31 PM
1113 views 3 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

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

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor

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

0 Likes

Hi Florian,

Thank you so much for the reply. It works.

Regards,

Medini H K

Answers (0)