<?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 Re: Insert into remote table - ORA-02019 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-remote-table-ora-02019/m-p/10439770#M1846459</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Chandra.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Test of DB connection gave me an error:&lt;/P&gt;&lt;P&gt;ORA-12154: TNS:could not resolve the connect identifier specified.&lt;/P&gt;&lt;P&gt;I have contacted BC team.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Jul 2014 09:47:22 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2014-07-02T09:47:22Z</dc:date>
    <item>
      <title>Insert into remote table - ORA-02019</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-remote-table-ora-02019/m-p/10439766#M1846455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to insert some data from SAP program to remote database table. Both SAP and remote tables are Oracle.&lt;/P&gt;&lt;P&gt;There is db link 'CONN' created with username 'conn_user'. SAP user which starts the program is different than 'conn_user'.&lt;/P&gt;&lt;P&gt;Insert statement gives me: The error 2019 occurred in the current database connection "DEFAULT".&lt;BR /&gt;After googling, I suppose the problem is how to connect to the remote database with user different than SAP's one, but I still have no clue about what is wrong in my code.&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXEC SQL.&lt;/P&gt;&lt;P&gt;CONNECT TO 'CONN' as 'conn_user'&lt;/P&gt;&lt;P&gt;ENDEXEC.&lt;/P&gt;&lt;P&gt;EXEC SQL.&lt;/P&gt;&lt;P&gt;insert into TABLE1@CONN ( company_code )&lt;/P&gt;&lt;P&gt;values&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; ( '1000' )&lt;/P&gt;&lt;P&gt;ENDEXEC.&lt;/P&gt;&lt;P&gt;EXEC SQL.&lt;/P&gt;&lt;P&gt;commit&lt;/P&gt;&lt;P&gt;ENDEXEC.&lt;/P&gt;&lt;P&gt;EXEC SQL.&lt;/P&gt;&lt;P&gt;DISCONNECT 'CONN'&lt;/P&gt;&lt;P&gt;ENDEXEC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2014 13:36:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-remote-table-ora-02019/m-p/10439766#M1846455</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-07-01T13:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: Insert into remote table - ORA-02019</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-remote-table-ora-02019/m-p/10439767#M1846456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Natasa&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why you pass the connection on insert? The statement above make connection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Other point you can connect in this form:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA v_conn LIKE DBCON-CON_NAME VALUE 'YOURCONN'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXEC SQL.&lt;/P&gt;&lt;P&gt;CONNECT TO :v_conn&lt;/P&gt;&lt;P&gt;ENDEXEC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Other point, why do you try to use ADBC ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2014 14:54:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-remote-table-ora-02019/m-p/10439767#M1846456</guid>
      <dc:creator>raphael_almeida</dc:creator>
      <dc:date>2014-07-01T14:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: Insert into remote table - ORA-02019</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-remote-table-ora-02019/m-p/10439768#M1846457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raphael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually, the problem is the statement&lt;/P&gt;&lt;P&gt;CONNECT TO 'CONN' as 'conn_user'&lt;/P&gt;&lt;P&gt;which doesn't make the connection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After that statement, sy-subrc is 4. Even when I read CON_NAME and USER_NAME from table DBCON, there is no change. I don't know what is wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And what is ADBC?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2014 08:00:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-remote-table-ora-02019/m-p/10439768#M1846457</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-07-02T08:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: Insert into remote table - ORA-02019</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-remote-table-ora-02019/m-p/10439769#M1846458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once the DB connection is establish between SAP and a remote DB, no need of user id and password during runtime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below code works for connecting remote DB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;EXEC SQL.&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;CONNECT TO :lv_dbcon&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;ENDEXEC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want test DB connection, go to SE38 / SA38 transaction and give ADBC_TEST_CONNECTION and test the DB Connection by providing DB Connection name in the selection screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2014 09:09:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-remote-table-ora-02019/m-p/10439769#M1846458</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-07-02T09:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: Insert into remote table - ORA-02019</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-remote-table-ora-02019/m-p/10439770#M1846459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Chandra.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Test of DB connection gave me an error:&lt;/P&gt;&lt;P&gt;ORA-12154: TNS:could not resolve the connect identifier specified.&lt;/P&gt;&lt;P&gt;I have contacted BC team.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2014 09:47:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-remote-table-ora-02019/m-p/10439770#M1846459</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-07-02T09:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: Insert into remote table - ORA-02019</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-remote-table-ora-02019/m-p/10439771#M1846460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;ORA-12154 is the error indicates that there is some thing wrong in TNS entry. Ask your BASIS team to check that correct TNS entry placed in SAP or not.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;Chandra&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2014 10:03:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-remote-table-ora-02019/m-p/10439771#M1846460</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-07-02T10:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: Insert into remote table - ORA-02019</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-remote-table-ora-02019/m-p/10439772#M1846461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I know what is that error and I informed BC team about that.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2014 10:35:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-remote-table-ora-02019/m-p/10439772#M1846461</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-07-02T10:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: Insert into remote table - ORA-02019</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-remote-table-ora-02019/m-p/10439773#M1846462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Natasa,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have this connection inserted on DBCO ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For connection with other databases you need:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The client configured on SAP Server (For Oracle - Oracle Client, For MSSQL - ODBC Entry, etc...);&lt;/LI&gt;&lt;LI&gt;This connection inserted on transaction DBCO and tested on transaction DB6TRC;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With this, how i said, you need pass the connection description (created on DBCO) in EXEC SQL ou ADBC Classes, how example below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/489055" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/489116" width="450" /&gt;&lt;/P&gt;&lt;P&gt;Example with EXEC SQL:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA v_conn LIKE DBCON-CON_NAME VALUE 'CONNECTIONDESCRIPTION'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXEC SQL.&lt;/P&gt;&lt;P&gt;CONNECT TO :v_conn&lt;/P&gt;&lt;P&gt;ENDEXEC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example with ADBC:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: og_connect&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;type &lt;SPAN class="L0S52"&gt;ref &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;to &lt;/SPAN&gt;cl_sql_connection&lt;SPAN class="L0S55"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v_conn LIKE DBCON-CON_NAME VALUE 'CONNECTIONDESCRIPTION'.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;create object og_connect&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; og_connect &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;cl_sql_connection&lt;SPAN class="L0S70"&gt;=&amp;gt;&lt;/SPAN&gt;get_connection&lt;SPAN class="L0S55"&gt;( &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;v_conn&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;Adding, on SAP have a demo program called ADBC_DEMO, which have more examples.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;Regards,&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2014 12:21:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-remote-table-ora-02019/m-p/10439773#M1846462</guid>
      <dc:creator>raphael_almeida</dc:creator>
      <dc:date>2014-07-02T12:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: Insert into remote table - ORA-02019</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-remote-table-ora-02019/m-p/10439774#M1846463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for late reply.&lt;/P&gt;&lt;P&gt;Finally, customer BC team solved the problem with tnsnames.&lt;/P&gt;&lt;P&gt;Thank you for helpful instructions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Natasa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 11:43:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-remote-table-ora-02019/m-p/10439774#M1846463</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-07-23T11:43:25Z</dc:date>
    </item>
  </channel>
</rss>

