<?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>topic ADBC Insert Query not working in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/adbc-insert-query-not-working/m-p/11753520#M1950533</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to insert records in database table, but its failing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I debug the statement, the CALL C_DB_FUNCTION returns sy-subrc 12.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my code for insertion :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;Create &lt;/SPAN&gt;the &lt;SPAN class="L0S52"&gt;SQL &lt;/SPAN&gt;statement object&lt;/P&gt;&lt;P&gt;&amp;nbsp; lo_sql_statement &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;lo_sql_connection&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;create_statement&lt;SPAN class="L0S55"&gt;( &lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S31"&gt;* To insert the records from internal table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; lo_sql_statement&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;set_param_table&lt;SPAN class="L0S55"&gt;( &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;REF &lt;/SPAN&gt;#&lt;SPAN class="L0S55"&gt;( &lt;/SPAN&gt;lt_materialid &lt;SPAN class="L0S55"&gt;) &lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S31"&gt;* Prepare the SQL Statement&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN class="L0S52"&gt;CONCATENATE &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'INSERT INTO' &lt;/SPAN&gt;c_tab_name &lt;SPAN class="L0S33"&gt;'VALUES( ?,? )' &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;INTO&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lv_sql_statement &lt;SPAN class="L0S52"&gt;SEPARATED &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;BY &lt;/SPAN&gt;space&lt;SPAN class="L0S55"&gt;.&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="L0S31"&gt;" #EC NOTEXT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S31"&gt;* Execute the SQL statement&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;TRY &lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lv_rows_processed &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;lo_sql_statement&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;execute_update&lt;SPAN class="L0S55"&gt;( &lt;/SPAN&gt;lv_sql_statement &lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;CATCH &lt;/SPAN&gt;cx_root &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;lx_root &lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXECUTE_UPDATE Method is not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any reviews in this??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sumit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Jun 2016 06:53:59 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2016-06-17T06:53:59Z</dc:date>
    <item>
      <title>ADBC Insert Query not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adbc-insert-query-not-working/m-p/11753520#M1950533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to insert records in database table, but its failing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I debug the statement, the CALL C_DB_FUNCTION returns sy-subrc 12.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my code for insertion :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;Create &lt;/SPAN&gt;the &lt;SPAN class="L0S52"&gt;SQL &lt;/SPAN&gt;statement object&lt;/P&gt;&lt;P&gt;&amp;nbsp; lo_sql_statement &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;lo_sql_connection&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;create_statement&lt;SPAN class="L0S55"&gt;( &lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S31"&gt;* To insert the records from internal table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; lo_sql_statement&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;set_param_table&lt;SPAN class="L0S55"&gt;( &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;REF &lt;/SPAN&gt;#&lt;SPAN class="L0S55"&gt;( &lt;/SPAN&gt;lt_materialid &lt;SPAN class="L0S55"&gt;) &lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S31"&gt;* Prepare the SQL Statement&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN class="L0S52"&gt;CONCATENATE &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'INSERT INTO' &lt;/SPAN&gt;c_tab_name &lt;SPAN class="L0S33"&gt;'VALUES( ?,? )' &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;INTO&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lv_sql_statement &lt;SPAN class="L0S52"&gt;SEPARATED &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;BY &lt;/SPAN&gt;space&lt;SPAN class="L0S55"&gt;.&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="L0S31"&gt;" #EC NOTEXT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S31"&gt;* Execute the SQL statement&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;TRY &lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lv_rows_processed &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;lo_sql_statement&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;execute_update&lt;SPAN class="L0S55"&gt;( &lt;/SPAN&gt;lv_sql_statement &lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;CATCH &lt;/SPAN&gt;cx_root &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;lx_root &lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXECUTE_UPDATE Method is not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any reviews in this??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sumit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jun 2016 06:53:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adbc-insert-query-not-working/m-p/11753520#M1950533</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-06-17T06:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: ADBC Insert Query not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adbc-insert-query-not-working/m-p/11753521#M1950534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sumit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how does the structure of your internal table lt_materialid and the structure of the db table (identified by c_tab_name) look like? Do the columns for which you wanna insert data match?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you you check the error messages in the possible raised exception (using method GET_TEXT, GET_LONG_TEXT)? The exception should be normally of type CX_SQL_EXCEPTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Florian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2016 05:06:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adbc-insert-query-not-working/m-p/11753521#M1950534</guid>
      <dc:creator>pfefferf</dc:creator>
      <dc:date>2016-06-20T05:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: ADBC Insert Query not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adbc-insert-query-not-working/m-p/11753522#M1950535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Florian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The structure for both Internal table and Database table are same. Both have 3 columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I dig deep into the exception it is just giving "EXTERNAL ERROR".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Same is the problem with "UPDATE". Update command is not working when I try to update multiple entries in a dbtab via internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sumit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2016 05:18:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adbc-insert-query-not-working/m-p/11753522#M1950535</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-06-20T05:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: ADBC Insert Query not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adbc-insert-query-not-working/m-p/11753523#M1950536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As suggested by Florian you can get exact message in exception.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As well as you can check the user used for secondary DB has appropriate rights.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Amol &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2016 05:56:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adbc-insert-query-not-working/m-p/11753523#M1950536</guid>
      <dc:creator>amol_samte</dc:creator>
      <dc:date>2016-06-20T05:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: ADBC Insert Query not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adbc-insert-query-not-working/m-p/11753524#M1950537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sumit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you show the structure of the table and the internal table + one data record you try to insert and which fails.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx.&lt;/P&gt;&lt;P&gt;Florian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jun 2016 04:48:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adbc-insert-query-not-working/m-p/11753524#M1950537</guid>
      <dc:creator>pfefferf</dc:creator>
      <dc:date>2016-06-21T04:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: ADBC Insert Query not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adbc-insert-query-not-working/m-p/11753525#M1950538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem for INSERT is solved. Since I am having 3 columns in my internal table, so the INSERT statement has to be changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it should be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INSERT INTO dbtab VALUES ( ?,?,? ). with 3 questions marks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sumit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jun 2016 05:14:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adbc-insert-query-not-working/m-p/11753525#M1950538</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-06-21T05:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: ADBC Insert Query not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adbc-insert-query-not-working/m-p/11753526#M1950539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks alot ..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2016 12:15:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adbc-insert-query-not-working/m-p/11753526#M1950539</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-06-30T12:15:40Z</dc:date>
    </item>
  </channel>
</rss>

