• <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 閱讀(214) 評論(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.
            久久婷婷国产综合精品 | 久久精品亚洲精品国产色婷| 无码国内精品久久综合88| 国产激情久久久久久熟女老人| 久久久久亚洲AV无码永不| 国产精品成人久久久久三级午夜电影| 久久久久久毛片免费看| 久久精品中文无码资源站| 国产亚州精品女人久久久久久| 亚洲色婷婷综合久久| 国产福利电影一区二区三区,免费久久久久久久精 | 99久久精品费精品国产 | 久久精品国产只有精品2020| 精品无码久久久久久国产| 国产亚洲精品久久久久秋霞| 岛国搬运www久久| 久久99精品久久久久久久不卡| 久久久久一级精品亚洲国产成人综合AV区 | 亚洲精品第一综合99久久| 国产成人精品久久一区二区三区 | 久久久久久久亚洲精品| 97热久久免费频精品99| 99久久国产宗和精品1上映| 人妻精品久久久久中文字幕| 九九久久精品无码专区| 青青青青久久精品国产| 99久久精品费精品国产一区二区| 久久久久久久久波多野高潮| 人妻无码久久精品| 久久久久久极精品久久久 | 综合人妻久久一区二区精品| 波多野结衣久久一区二区| 伊人热热久久原色播放www| 亚洲精品无码专区久久同性男| 国产精品日韩深夜福利久久| 91精品国产高清久久久久久91| 久久久综合九色合综国产| 久久国产一区二区| 94久久国产乱子伦精品免费| 99久久精品免费国产大片| 免费精品久久久久久中文字幕|