<?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: Native SQL - Get query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-get-query/m-p/11325827#M1919480</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your suggestion, &lt;A __default_attr="639928" __jive_macro_name="user" class="jive_macro_user jive_macro" data-objecttype="3" data-orig-content="Raphael Pacheco" href="https://community.sap.com/"&gt;&lt;/A&gt; but I will not use ABDC because this is not a mine development. There is another guy who works with me and he doesn't know how to do that by himself, I just posted here to help him.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your suggestion too, &lt;SPAN style="background-color: #ffffff;"&gt;&lt;STRONG&gt;&lt;A __default_attr="299095" __jive_macro_name="user" class="jive_macro_user jive_macro" data-objecttype="3" data-orig-content="Juan Suros" href="https://community.sap.com/"&gt;&lt;/A&gt; !&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Oct 2015 10:56:16 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2015-10-08T10:56:16Z</dc:date>
    <item>
      <title>Native SQL - Get query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-get-query/m-p/11325824#M1919477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have many codes like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXEC SQL.&lt;/P&gt;&lt;P&gt;&amp;nbsp; INSERT INTO T_ORACLE_TABLE ( field1, field2, field3 )&lt;/P&gt;&lt;P&gt;&amp;nbsp; VALUES ( :t_sap_table-field1, :t_sap_table-field2, :t_sap_table-field3 )&lt;/P&gt;&lt;P&gt;ENDEXEC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is just an example, but the real queries are bigger than that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to save this query with values in a Ztable, something like a string "insert into oracle_Table(field1,field2,field3) values('value1', 'value2', 'value3')".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Does anyone know if is it possible to get the query I'm doing?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Oct 2015 17:00:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-get-query/m-p/11325824#M1919477</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-10-07T17:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: Native SQL - Get query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-get-query/m-p/11325825#M1919478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can execute one or more pre-created queries in your Z table by doing the following steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Loop through the Z table of queries&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) for each query you want to execute, add five rows to a itab of code lines as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'courier new', courier;"&gt;code_itab = 'FORM one_of_n.&lt;SPAN style="font-family: 'courier new', courier; font-size: 10.6667px;"&gt;'.&lt;SPAN style="font-family: 'courier new', courier; font-size: 10.6667px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10.6667px;"&gt;APPEND code_itab.&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'courier new', courier;"&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10.6667px;"&gt;code_itab = '&lt;/SPAN&gt;EXEC SQL.&lt;SPAN style="font-family: 'courier new', courier; font-size: 10.6667px;"&gt;'.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'courier new', courier; font-size: 10.6667px;"&gt;APPEND code_itab.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'courier new', courier;"&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10.6667px;"&gt;code_itab = '&lt;/SPAN&gt;&amp;lt;query string here&amp;gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10.6667px;"&gt;'. APPEND code_itab.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'courier new', courier;"&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10.6667px;"&gt;code_itab = '&lt;/SPAN&gt;ENDEXEC.&lt;SPAN style="font-family: 'courier new', courier; font-size: 10.6667px;"&gt;'. &lt;SPAN style="font-family: 'courier new', courier; font-size: 10.6667px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10.6667px;"&gt;APPEND code_itab.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'courier new', courier;"&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10.6667px;"&gt;code_itab = '&lt;/SPAN&gt;ENDFORM.'. &lt;SPAN style="font-family: 'courier new', courier; font-size: 10.6667px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10.6667px;"&gt;APPEND code_itab.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) create a utility report containing your query using this command:&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: 8pt; font-family: 'courier new', courier;"&gt;GENERATE SUBROUTINE POOL code_itab NAME zmy_utility MESSAGE errors.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;4) Call each query in turn&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;&lt;SPAN style="font-size: 8pt; font-family: 'courier new', courier;"&gt;PERFORM one_of_n&amp;nbsp;&amp;nbsp; in PROGRAM z_my_utility CHANGING results.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #333333; font-size: 12px; font-family: 'courier new', courier;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;PERFORM two_of_n&amp;nbsp;&amp;nbsp; in PROGRAM &lt;SPAN style="color: #333333; font-family: 'courier new', courier; font-size: 10.6667px;"&gt;z_my_&lt;/SPAN&gt;utility CHANGING results2.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #333333; font-size: 8pt; font-family: 'courier new', courier;"&gt;PERFORM three_of_n in PROGRAM &lt;SPAN style="color: #333333; font-family: 'courier new', courier; font-size: 10.6667px;"&gt;z_my_&lt;/SPAN&gt;utility CHANGING results3.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;that should work nicely. Here are a couple of tips.&lt;BR /&gt;&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;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;You might try defining "code_itab" as follows:&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;SPAN style="color: #333333; font-size: 12px;"&gt;DATA: code_itab TYPE STANDARD TABLE OF tline-tdline.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See below for a complete solution to a simpler but similar problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A __default_attr="17002" __jive_macro_name="thread" class="jive_macro_thread jive_macro" data-orig-content="How to execute this SQL Query in ABAP Program." href="https://community.sap.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Oct 2015 22:27:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-get-query/m-p/11325825#M1919478</guid>
      <dc:creator>juan_suros</dc:creator>
      <dc:date>2015-10-07T22:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: Native SQL - Get query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-get-query/m-p/11325826#M1919479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="alt-edited hps"&gt;Why&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;you just do not&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;use the&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;ADBC&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;and tries to&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;dynamically&lt;/SPAN&gt; &lt;SPAN class="alt-edited hps"&gt;run your&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;DML&lt;/SPAN&gt; &lt;SPAN class="alt-edited hps"&gt;statements?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="alt-edited hps"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="alt-edited hps"&gt;(Just a suggestion for improvements).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="alt-edited hps"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="alt-edited hps"&gt;BR,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="alt-edited hps"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="alt-edited hps"&gt;Raphael Pacheco.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Oct 2015 23:50:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-get-query/m-p/11325826#M1919479</guid>
      <dc:creator>raphael_almeida</dc:creator>
      <dc:date>2015-10-07T23:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Native SQL - Get query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-get-query/m-p/11325827#M1919480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your suggestion, &lt;A __default_attr="639928" __jive_macro_name="user" class="jive_macro_user jive_macro" data-objecttype="3" data-orig-content="Raphael Pacheco" href="https://community.sap.com/"&gt;&lt;/A&gt; but I will not use ABDC because this is not a mine development. There is another guy who works with me and he doesn't know how to do that by himself, I just posted here to help him.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your suggestion too, &lt;SPAN style="background-color: #ffffff;"&gt;&lt;STRONG&gt;&lt;A __default_attr="299095" __jive_macro_name="user" class="jive_macro_user jive_macro" data-objecttype="3" data-orig-content="Juan Suros" href="https://community.sap.com/"&gt;&lt;/A&gt; !&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2015 10:56:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-get-query/m-p/11325827#M1919480</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-10-08T10:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: Native SQL - Get query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-get-query/m-p/11325828#M1919481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your feedback.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Show to him the demo program called "ADBC_DEMO", it's a sample program what explain all statements using ADBC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Warm regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Raphael Pacheco.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2015 12:36:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-get-query/m-p/11325828#M1919481</guid>
      <dc:creator>raphael_almeida</dc:creator>
      <dc:date>2015-10-08T12:36:07Z</dc:date>
    </item>
  </channel>
</rss>

