• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            Prayer

            在一般中尋求卓越
            posts - 1256, comments - 190, trackbacks - 0, articles - 0
              C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

            Held and non-held cursors

            Posted on 2010-05-12 23:21 Prayer 閱讀(213) 評論(0)  編輯 收藏 引用 所屬分類: DB2

            http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db29.doc.apsg/db2z_heldnonheldcursor.htm

            Held and non-held cursors

            A held cursor does not close after a commit operation. A cursor that is not held closes after a commit operation. You specify whether you want a cursor to be held or not held by including or omitting the WITH HOLD clause when you declare the cursor.

            After a commit operation, the position of a held cursor depends on its type:
            • A non-scrollable cursor that is held is positioned after the last retrieved row and before the next logical row. The next row can be returned from the result table with a FETCH NEXT statement.
            • A static scrollable cursor that is held is positioned on the last retrieved row. The last retrieved row can be returned from the result table with a FETCH CURRENT statement.
            • A dynamic scrollable cursor that is held is positioned after the last retrieved row and before the next logical row. The next row can be returned from the result table with a FETCH NEXT statement. DB2® returns SQLCODE +231 for a FETCH CURRENT statement.
            A held cursor can close when:
            • You issue a CLOSE cursor, ROLLBACK, or CONNECT statement
            • You issue a CAF CLOSE function call or an RRSAF TERMINATE THREAD function call
            • The application program terminates.

            If the program abnormally terminates, the cursor position is lost. To prepare for restart, your program must reposition the cursor.

            The following restrictions apply to cursors that are declared WITH HOLD:
            • Do not use DECLARE CURSOR WITH HOLD with the new user signon from a DB2 attachment facility, because all open cursors are closed.
            • Do not declare a WITH HOLD cursor in a thread that might become inactive. If you do, its locks are held indefinitely.

            IMS™

            You cannot use DECLARE CURSOR...WITH HOLD in message processing programs (MPP) and message-driven batch message processing (BMP). Each message is a new user for DB2; whether or not you declare them using WITH HOLD, no cursors continue for new users. You can use WITH HOLD in non-message-driven BMP and DL/I batch programs.

            CICS

            In CICS® applications, you can use DECLARE CURSOR...WITH HOLD to indicate that a cursor should not close at a commit or sync point. However, SYNCPOINT ROLLBACK closes all cursors, and end-of-task (EOT) closes all cursors before DB2 reuses or terminates the thread. Because pseudo-conversational transactions usually have multiple EXEC CICS RETURN statements and thus span multiple EOTs, the scope of a held cursor is limited. Across EOTs, you must reopen and reposition a cursor declared WITH HOLD, as if you had not specified WITH HOLD.

            You should always close cursors that you no longer need. If you let DB2 close a CICS attachment cursor, the cursor might not close until the CICS attachment facility reuses or terminates the thread.

            The following cursor declaration causes the cursor to maintain its position in the DSN8910.EMP table after a commit point:
            
            EXEC SQL
            DECLARE EMPLUPDT CURSOR WITH HOLD FOR
            SELECT EMPNO, LASTNAME, PHONENO, JOB, SALARY, WORKDEPT
            FROM DSN8910.EMP
            WHERE WORKDEPT < 'D11'
            ORDER BY EMPNO
            END-EXEC.
            国产精品欧美久久久久无广告| 亚洲国产精品成人AV无码久久综合影院| 久久久精品一区二区三区| 久久99国产综合精品| 88久久精品无码一区二区毛片| 久久精品国产亚洲5555| 久久人人爽人人爽人人片AV不| 亚洲香蕉网久久综合影视| 亚洲国产精品久久久久网站| 91久久精品电影| 一级a性色生活片久久无少妇一级婬片免费放 | 欧美亚洲国产精品久久| 97久久香蕉国产线看观看| 欧美一区二区久久精品| 欧美日韩中文字幕久久伊人| 久久综合给合综合久久| 国产99久久久国产精品~~牛| 亚洲国产小视频精品久久久三级 | 亚洲国产精品无码久久久不卡 | 精品久久一区二区三区| 久久香综合精品久久伊人| 久久精品国产亚洲综合色| 久久亚洲精品无码VA大香大香| 国产成人香蕉久久久久| 久久人爽人人爽人人片AV | 久久综合综合久久97色| 精品久久久久久久久免费影院| 99久久免费只有精品国产| 久久天堂AV综合合色蜜桃网| 久久天天躁狠狠躁夜夜2020一| 久久精品这里只有精99品| 色综合色天天久久婷婷基地| 久久精品人人做人人妻人人玩| 婷婷伊人久久大香线蕉AV | 亚洲va中文字幕无码久久不卡| 久久婷婷人人澡人人| 精品久久久久久久中文字幕| 久久伊人中文无码| 久久久网中文字幕| 中文字幕无码久久久| 精品国产乱码久久久久软件|