<?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: Update Query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-query/m-p/1452746#M214249</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your answer.If was wondering since there are million entries is it good to select all the columns of the table?(Since I need to update only one column of the table).Also since there are million entries single update statement will not cause time out?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 24 Jun 2006 06:41:37 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-06-24T06:41:37Z</dc:date>
    <item>
      <title>Update Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-query/m-p/1452744#M214247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to update a z table from a internal table.There are million entries in the table.&lt;/P&gt;&lt;P&gt;Performance wise which one of the two is better.Please note that I need to update only two fileds of the table dbtab.dbtab has 20 fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the first option i'm pulling only two columns in the second select statment.Which forces me to loop to update.&lt;/P&gt;&lt;P&gt;In the second option i'm pulling all the 20 columns in the second select statment.Which gives me the liberty to update in one statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreicate your help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.&lt;/P&gt;&lt;P&gt;f1 =  key&lt;/P&gt;&lt;P&gt;f2 = field to change&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT L1 L2&lt;/P&gt;&lt;P&gt;              FROM datbone &lt;/P&gt;&lt;P&gt;             INTO TABLE itabone&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;LOOP AT itabone INTO waone&lt;/P&gt;&lt;P&gt;SELECT f1 f2 &lt;/P&gt;&lt;P&gt;             INTO TABLE itab &lt;/P&gt;&lt;P&gt;             package size 10000&lt;/P&gt;&lt;P&gt;             FROM dtab&lt;/P&gt;&lt;P&gt;             where f3 = waone-L1.&lt;/P&gt;&lt;P&gt;             change the field f2 of itab&lt;/P&gt;&lt;P&gt;ENDSELECT&lt;/P&gt;&lt;P&gt;ENDLOOP. &lt;/P&gt;&lt;P&gt;              &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;LOOP AT itab INTO wa&lt;/P&gt;&lt;P&gt;       UPDATE dbtab SET f2 = wa-f2 &lt;/P&gt;&lt;P&gt;ENDLOOP       &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the above only the key and &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT L1 L2&lt;/P&gt;&lt;P&gt;              FROM datbone &lt;/P&gt;&lt;P&gt;             INTO TABLE itabone&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itabone INTO waone&lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;             INTO TABLE itab &lt;/P&gt;&lt;P&gt;             package size 10000&lt;/P&gt;&lt;P&gt;             FROM dtab&lt;/P&gt;&lt;P&gt;             where f3 = waone-L1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;             change the field f2 of itab&lt;/P&gt;&lt;P&gt;ENDSELECT&lt;/P&gt;&lt;P&gt;ENDLOOP. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE dbtab FROM TABLE itab&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Jun 2006 03:50:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-query/m-p/1452744#M214247</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-24T03:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: Update Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-query/m-p/1452745#M214248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How abt this one?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT L1 L2&lt;/P&gt;&lt;P&gt;FROM datbone &lt;/P&gt;&lt;P&gt;INTO TABLE itabone&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not itabone[] is initial.&lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;FROM dtab&lt;/P&gt;&lt;P&gt;INTO TABLE itab&lt;/P&gt;&lt;P&gt;for all entries in itabone&lt;/P&gt;&lt;P&gt;package size 10000&lt;/P&gt;&lt;P&gt;where f3 = itabone-L1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE dbtab FROM TABLE itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points if it helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Gunjan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Jun 2006 05:19:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-query/m-p/1452745#M214248</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-24T05:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: Update Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-query/m-p/1452746#M214249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your answer.If was wondering since there are million entries is it good to select all the columns of the table?(Since I need to update only one column of the table).Also since there are million entries single update statement will not cause time out?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Jun 2006 06:41:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-query/m-p/1452746#M214249</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-24T06:41:37Z</dc:date>
    </item>
  </channel>
</rss>

