<?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: Error while calling procedure from python sqlalchemy in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/error-while-calling-procedure-from-python-sqlalchemy/qaa-p/12207783#M4568219</link>
    <description>&lt;P&gt;Dear Arunkumar&lt;/P&gt;&lt;P&gt;Actually the DB procedure a table[] is expected... not the string of data. &lt;/P&gt;&lt;P&gt;So you may have to write something like this&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DO BEGIN    

-- select values from table to fill the table
   tabledata = SELECT * from xyz;            
        
    
 test=engine.execute('call SCHEMA.PROC(?,?)',(tabledata,output))
END;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 12 Mar 2020 05:42:27 GMT</pubDate>
    <dc:creator>venkateswaran_k</dc:creator>
    <dc:date>2020-03-12T05:42:27Z</dc:date>
    <item>
      <title>Error while calling procedure from python sqlalchemy</title>
      <link>https://community.sap.com/t5/technology-q-a/error-while-calling-procedure-from-python-sqlalchemy/qaq-p/12207781</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
  &lt;P&gt;I am getting an error when i call a stored procedure with table type input and a varchar out param from python using the sqlalchemy lib.Below mentioned is the error&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;Error while calling procedure from python sqlalchemy.exc.DatabaseError: (pyhdb.exceptions.DatabaseError) invalid argument: Input parameter is inadequate as table parameter:&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;parameter one is table type in and second is a varchar out &lt;/P&gt;
  &lt;P&gt;I am adding the code snippet which i am trying with&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;engine = create_engine("hana+pyhdb://{username}:{password}@{host}:{port}".format(username='username', password='password', host='hostname', port='30015'))&lt;/CODE&gt;&lt;/PRE&gt; 
  &lt;PRE&gt;&lt;CODE&gt;output="
data='[{"RULE_ID":1,"RULE_NAME":null,"SO_SSA":"1074","PO_NUMBER":null,"CODE":"DDD","ROUTE_CODE":"","OPERATING":null,"SHIP_TO":"IND","SHIP_TO_REGION":"MX","SHIP_TO_CUSTOMER_ID":null,"BILL_TO_CUSTOMER_ID":null,"END_TO_CUSTOMER_ID":null,"SLCA":"AKP123","HOLD_NAME":"Futures Approval Hold","SHIPPING_PREFERENCE":null,"EAD":null,"CUSTOMER_REQUEST_TYPE":null,"CRD":null,"CRSD":null,"CURRENT_PROMISE_DATE":null,"CURRENT_PROMISE_DELIVERY_DATE":null,"OPDATE":null,"OPDD":null,"ON_HOLD":null,"FLOW_STATUS_CODE":null,"PICK_RESULT":null,"IS_IN_OTM":null,"BUSINESS_UNIT":null,"REVENUE_FLAG":null,"ACTION_CATEGORY":null,"ACTION_OWNER":null,"SS_REVENUE":null,"CARTONS":null,"INVOICE_ELIGIBILITY_EVENT":null,"SALES_CHANNEL":null,"CREATED_BY":"NEW","CREATION_DATE":"2020-02-11 10:24PM","LAST_UPDATED_BY":"NEW","LAST_UPDATE_DATE":"2020-03-04 10:39PM","FDA_FLAG":null,"POE_FLAG":null,"CONSOLIDATED_FLAG":null,"START_DATE":"2019-01-02","END_DATE":"2020-01-02","ACTIVE":"T"}]'

test=engine.execute('call SCHEMA.PROC(?,?)',(data,output))
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Mar 2020 18:53:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-while-calling-procedure-from-python-sqlalchemy/qaq-p/12207781</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-03-11T18:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Error while calling procedure from python sqlalchemy</title>
      <link>https://community.sap.com/t5/technology-q-a/error-while-calling-procedure-from-python-sqlalchemy/qaa-p/12207782#M4568218</link>
      <description>&lt;P&gt;Thank
you for visiting SAP Community to get answers to your questions. Since you're
asking a question here for the first time, I recommend that you familiarize
yourself with &lt;A href="https://community.sap.com/resources/questions-and-answers" target="test_blank"&gt;https://community.sap.com/resources/questions-and-answers&lt;/A&gt; (if you
haven't already), as it provides tips for preparing questions that draw
responses from our members.&lt;/P&gt;&lt;P&gt;Should
you wish, you can revise your question by selecting Actions, then Edit
(although once someone answers your question, you'll lose the ability to edit
the question -- but if that happens, you can leave more details in a comment).&lt;/P&gt;&lt;P&gt;--Jerry&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2020 18:56:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-while-calling-procedure-from-python-sqlalchemy/qaa-p/12207782#M4568218</guid>
      <dc:creator>jerryjanda</dc:creator>
      <dc:date>2020-03-11T18:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: Error while calling procedure from python sqlalchemy</title>
      <link>https://community.sap.com/t5/technology-q-a/error-while-calling-procedure-from-python-sqlalchemy/qaa-p/12207783#M4568219</link>
      <description>&lt;P&gt;Dear Arunkumar&lt;/P&gt;&lt;P&gt;Actually the DB procedure a table[] is expected... not the string of data. &lt;/P&gt;&lt;P&gt;So you may have to write something like this&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DO BEGIN    

-- select values from table to fill the table
   tabledata = SELECT * from xyz;            
        
    
 test=engine.execute('call SCHEMA.PROC(?,?)',(tabledata,output))
END;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Mar 2020 05:42:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-while-calling-procedure-from-python-sqlalchemy/qaa-p/12207783#M4568219</guid>
      <dc:creator>venkateswaran_k</dc:creator>
      <dc:date>2020-03-12T05:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: Error while calling procedure from python sqlalchemy</title>
      <link>https://community.sap.com/t5/technology-q-a/error-while-calling-procedure-from-python-sqlalchemy/qaa-p/12207784#M4568220</link>
      <description>&lt;P&gt;Hi Arunkumar KP,
The hana_ml library can upload a Pandas dataframe into HANA. It creates the table in the necessary format and persists the data.  &lt;SPAN class="mention-scrubbed"&gt;vitaliy.rudnytskiy&lt;/SPAN&gt;  shows an example in his blog
&lt;A href="https://blogs.sap.com/2020/03/11/quickly-load-covid-19-data-with-hana_ml-and-see-with-dbeaver/" target="test_blank"&gt;https://blogs.sap.com/2020/03/11/quickly-load-covid-19-data-with-hana_ml-and-see-with-dbeaver/&lt;/A&gt;
&lt;BR /&gt;&lt;BR /&gt;The create_dataframe_from_pandas function is explained here
&lt;A href="https://help.sap.com/doc/1d0ebfe5e8dd44d09606814d83308d4b/2.0.04/en-US/hana_ml.dataframe.html#hana_ml.dataframe.create_dataframe_from_pandas" target="test_blank"&gt;https://help.sap.com/doc/1d0ebfe5e8dd44d09606814d83308d4b/2.0.04/en-US/hana_ml.dataframe.html#hana_ml.dataframe.create_dataframe_from_pandas&lt;/A&gt;
&lt;BR /&gt;&lt;BR /&gt;More information on the hana_ml wrapper in the blog by   &lt;SPAN class="mention-scrubbed"&gt;christoph.morgen&lt;/SPAN&gt; &lt;A href="https://blogs.sap.com/2020/02/24/updates-for-the-data-scientist-building-sap-hana-embedded-machine-learning-scenarios-from-python-or-r/" target="test_blank"&gt;https://blogs.sap.com/2020/02/24/updates-for-the-data-scientist-building-sap-hana-embedded-machine-learning-scenarios-from-python-or-r/&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Please just verify with your Account Executive, that your HANA license allows this usage.&lt;BR /&gt;Many Greetings
Andreas&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 09:45:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-while-calling-procedure-from-python-sqlalchemy/qaa-p/12207784#M4568220</guid>
      <dc:creator>AndreasForster</dc:creator>
      <dc:date>2020-03-16T09:45:44Z</dc:date>
    </item>
  </channel>
</rss>

