<?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 Commit work withour close all open database cursors in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-withour-close-all-open-database-cursors/m-p/6977260#M1492157</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all, I have following problem...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do a open cursor and fetch... than after 100000 records I need to save some data in a other table with insert.&lt;/P&gt;&lt;P&gt;when I do the commit work it will close all open database cursors...and the fetch will dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there not a command or Function Module which only close the database cursor which I did the insert ?&lt;/P&gt;&lt;P&gt;Or a commit work without closing database cursor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;OPEN CURSOR DBCURSOR FOR
    SELECT * FROM Z1
       WHERE f1 EQ P_F1
      and        f2 eq P_F2
      ORDER BYf1 f2 f3.

  CLEAR DB_INDEX.

  DO.
    FETCH NEXT CURSOR DBCURSOR INTO WA1.

    IF SY-SUBRC EQ 0.
      IF DB_INDEX GE 100000.
        INSERT Z1 from it1.
**** commit work ****
       CLEAR DB_INDEX.
       refresh it1.
      ENDIF.
      ADD 1 TO DB_INDEX.
      APPEND WA1 TO IT1.
    ELSE.
      EXIT.
    ENDIF.
  ENDDO.

  CLOSE CURSOR DBCURSOR.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Jun 2010 12:31:54 GMT</pubDate>
    <dc:creator>former_member216100</dc:creator>
    <dc:date>2010-06-01T12:31:54Z</dc:date>
    <item>
      <title>Commit work withour close all open database cursors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-withour-close-all-open-database-cursors/m-p/6977260#M1492157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all, I have following problem...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do a open cursor and fetch... than after 100000 records I need to save some data in a other table with insert.&lt;/P&gt;&lt;P&gt;when I do the commit work it will close all open database cursors...and the fetch will dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there not a command or Function Module which only close the database cursor which I did the insert ?&lt;/P&gt;&lt;P&gt;Or a commit work without closing database cursor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;OPEN CURSOR DBCURSOR FOR
    SELECT * FROM Z1
       WHERE f1 EQ P_F1
      and        f2 eq P_F2
      ORDER BYf1 f2 f3.

  CLEAR DB_INDEX.

  DO.
    FETCH NEXT CURSOR DBCURSOR INTO WA1.

    IF SY-SUBRC EQ 0.
      IF DB_INDEX GE 100000.
        INSERT Z1 from it1.
**** commit work ****
       CLEAR DB_INDEX.
       refresh it1.
      ENDIF.
      ADD 1 TO DB_INDEX.
      APPEND WA1 TO IT1.
    ELSE.
      EXIT.
    ENDIF.
  ENDDO.

  CLOSE CURSOR DBCURSOR.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jun 2010 12:31:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-withour-close-all-open-database-cursors/m-p/6977260#M1492157</guid>
      <dc:creator>former_member216100</dc:creator>
      <dc:date>2010-06-01T12:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Commit work withour close all open database cursors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-withour-close-all-open-database-cursors/m-p/6977261#M1492158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think so. Whenever a COMMIT WORK is encountered all the DB cursors are closed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why do you need to do a COMMIT after the INSERT? You can COMMIT the DB changes in a single shot after your CLOSE CURSOR statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jun 2010 12:40:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-withour-close-all-open-database-cursors/m-p/6977261#M1492158</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-06-01T12:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Commit work withour close all open database cursors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-withour-close-all-open-database-cursors/m-p/6977262#M1492159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Press F1 on OPEN CURSOR and read the option WITH HOLD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jun 2010 16:30:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-withour-close-all-open-database-cursors/m-p/6977262#M1492159</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-01T16:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: Commit work withour close all open database cursors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-withour-close-all-open-database-cursors/m-p/6977263#M1492160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thx, it was the with hold and I forgot only the native sql statement so when I was using FM DB_COMMIT&lt;/P&gt;&lt;P&gt;it was working, thanks a lot&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jun 2010 17:13:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-withour-close-all-open-database-cursors/m-p/6977263#M1492160</guid>
      <dc:creator>former_member216100</dc:creator>
      <dc:date>2010-06-01T17:13:38Z</dc:date>
    </item>
  </channel>
</rss>

