<?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: CURSOR method in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/cursor-method/m-p/6615360#M1439720</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;The best method i can think of is update the data outside the SQL. Collect data into an internal table. Once all the data is collected, close all the cursors, then INSERT the data into ZTABLE at single shot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Logic behind this is, it reduces the number of database hits. As we know database operations works on queing principles. So instead of waiting in Q for each INSERT statement, update the data at once and COMMIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you got the logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Feb 2010 14:08:55 GMT</pubDate>
    <dc:creator>vinod_vemuru2</dc:creator>
    <dc:date>2010-02-11T14:08:55Z</dc:date>
    <item>
      <title>CURSOR method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cursor-method/m-p/6615356#M1439716</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;Im using cursor method in my sql query. For two tables, im putting the cursor. Im populating data from two tables into third internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, the data from third internal table is inserted into a ztable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;During this entire process, my first cursor will be opened and second cursor will be open and closed till it gets the complete records based on first cursor. data insertion happens into a ztable and finally closing the cursor for the first one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;open cursor dbcur1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;open cursor dbcur2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;close cursor dbcur2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;inserting into ztable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;close cursor dbcur1. }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is that a huge time is consumed while inserting the rows into dbtable. Here, im trying to do a batch processing. So for each batch process, my ztable will be inserted with new records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, what the best case of reducing the time for processing this activity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;rohith&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2010 10:59:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cursor-method/m-p/6615356#M1439716</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-11T10:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: CURSOR method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cursor-method/m-p/6615357#M1439717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rohit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use WAIT 5 seconds statement for each batch processing.It means after uploading the first recod into dbtable then only next process has to be done.It reduces the time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sri Ramya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2010 11:08:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cursor-method/m-p/6615357#M1439717</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-11T11:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: CURSOR method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cursor-method/m-p/6615358#M1439718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ramya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this is a database commit and this will cause a run time error. Since, the cursor is still not completed and the program is trying to commit work on the database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Rohith&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2010 11:18:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cursor-method/m-p/6615358#M1439718</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-11T11:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: CURSOR method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cursor-method/m-p/6615359#M1439719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you may try with limiting the selection using PACKAGE SIZE and hence less no. of db commits at one time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2010 13:58:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cursor-method/m-p/6615359#M1439719</guid>
      <dc:creator>Sandeep_Panghal</dc:creator>
      <dc:date>2010-02-11T13:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: CURSOR method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cursor-method/m-p/6615360#M1439720</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;The best method i can think of is update the data outside the SQL. Collect data into an internal table. Once all the data is collected, close all the cursors, then INSERT the data into ZTABLE at single shot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Logic behind this is, it reduces the number of database hits. As we know database operations works on queing principles. So instead of waiting in Q for each INSERT statement, update the data at once and COMMIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you got the logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2010 14:08:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cursor-method/m-p/6615360#M1439720</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2010-02-11T14:08:55Z</dc:date>
    </item>
  </channel>
</rss>

