<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: &amp;quot;Input Parameter is Inadequate as Table Parameter&amp;quot; error while calling PAL_LINEAR_REGRESSION in xsjs in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/quot-input-parameter-is-inadequate-as-table-parameter-quot-error-while/qaa-p/749795#M212985</link>
    <description>&lt;P&gt;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.&lt;/P&gt;
  &lt;P&gt;Regards,&lt;BR /&gt;Florian&lt;/P&gt;</description>
    <pubDate>Sun, 19 Aug 2018 09:27:01 GMT</pubDate>
    <dc:creator>pfefferf</dc:creator>
    <dc:date>2018-08-19T09:27:01Z</dc:date>
    <item>
      <title>"Input Parameter is Inadequate as Table Parameter" error while calling PAL_LINEAR_REGRESSION in xsjs</title>
      <link>https://community.sap.com/t5/technology-q-a/quot-input-parameter-is-inadequate-as-table-parameter-quot-error-while/qaq-p/749793</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;I tried to call the Predictive Analytics Procedure "PAL_LINEAR_REGRESSION" in xsjs,&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;and below is my code:&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; function LR()&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; {&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; try&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; { var in1 = '"'+"PS_DATA"+'".'+'"'+"GROSSMARGIN1"+'"';&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; var in2 = '"'+"PS_DATA"+'".'+'"'+"PAL_CONTROL_TBL"+'"';&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; var output1 = [];&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; var conn1 = $.hdb.getConnection(); &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; var fn = conn1.loadProcedure("_SYS_AFL","PAL_LINEAR_REGRESSION");&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; var fnResult = fn(in1,in2);;&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;conn1.commit();&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; conn1.close(); &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; output1.push(fnResult); &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;} catch(e) {&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; $.response.setBody(e.toString()); }&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;}&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; $.response.setBody(JSON.stringify(LR()));&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;//where I'm getting error as,&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; 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&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;But if I run the same procedure in console it is giving the proper output, for the sql call,&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;call "_SYS_AFL"."PAL_LINEAR_REGRESSION"("PS_DATA"."GROSSMARGIN1","PS_DATA"."PAL_CONTROL_TBL",?,?,?,?,?),&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Can someone please help me out in this regard.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Thanks in Advance,&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Medini H K&lt;/P&gt;</description>
      <pubDate>Thu, 16 Aug 2018 10:31:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/quot-input-parameter-is-inadequate-as-table-parameter-quot-error-while/qaq-p/749793</guid>
      <dc:creator>former_member510186</dc:creator>
      <dc:date>2018-08-16T10:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: "Input Parameter is Inadequate as Table Parameter" error while calling PAL_LINEAR_REGRESSION in xsjs</title>
      <link>https://community.sap.com/t5/technology-q-a/quot-input-parameter-is-inadequate-as-table-parameter-quot-error-while/qaa-p/749794#M212984</link>
      <description>&lt;P&gt;this is related to SAP HANA - hence updating the tags. &lt;/P&gt;</description>
      <pubDate>Fri, 17 Aug 2018 12:09:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/quot-input-parameter-is-inadequate-as-table-parameter-quot-error-while/qaa-p/749794#M212984</guid>
      <dc:creator>achab</dc:creator>
      <dc:date>2018-08-17T12:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: "Input Parameter is Inadequate as Table Parameter" error while calling PAL_LINEAR_REGRESSION in xsjs</title>
      <link>https://community.sap.com/t5/technology-q-a/quot-input-parameter-is-inadequate-as-table-parameter-quot-error-while/qaa-p/749795#M212985</link>
      <description>&lt;P&gt;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.&lt;/P&gt;
  &lt;P&gt;Regards,&lt;BR /&gt;Florian&lt;/P&gt;</description>
      <pubDate>Sun, 19 Aug 2018 09:27:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/quot-input-parameter-is-inadequate-as-table-parameter-quot-error-while/qaa-p/749795#M212985</guid>
      <dc:creator>pfefferf</dc:creator>
      <dc:date>2018-08-19T09:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: "Input Parameter is Inadequate as Table Parameter" error while calling PAL_LINEAR_REGRESSION in xsjs</title>
      <link>https://community.sap.com/t5/technology-q-a/quot-input-parameter-is-inadequate-as-table-parameter-quot-error-while/qaa-p/749796#M212986</link>
      <description>&lt;P&gt;Hi Florian,&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Thank you so much for the reply. It works.&lt;/P&gt;
  &lt;P&gt;Regards,&lt;/P&gt;
  &lt;P&gt;Medini H K&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Aug 2018 12:29:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/quot-input-parameter-is-inadequate-as-table-parameter-quot-error-while/qaa-p/749796#M212986</guid>
      <dc:creator>former_member510186</dc:creator>
      <dc:date>2018-08-20T12:29:08Z</dc:date>
    </item>
  </channel>
</rss>

