BUG: ESQL: User-Defined Transaction Names Are Ignored

Last reviewed: April 29, 1997
Article ID: Q112986

The information in this article applies to:

  - Microsoft Embedded SQL version 4.21 for COBOL
BUG# 9905 (4.21)

SYMPTOMS

In Embedded SQL for Cobol (ESQL/COBOL) applications, a transaction name in a user-defined transaction is ignored during run time. For example, if the ESQL/COBOL statement is BEGIN TRAN MYTRAN, only BEGIN TRAN is sent to SQL Server at run time, and MYTRAN is ignored.

This does not cause any problems with BEGIN TRAN, COMMIT TRAN or ROLLBACK TRAN, as the transaction name is optional. However, when SAVE TRAN is used, a syntax error will occur at run time because SAVE TRAN requires a transaction name:

   Syntax error near "tran"

CAUSE

SQL Server Embedded SQL for COBOL incorrectly ignores transaction names for user-defined transactions.

WORKAROUND

As a single transaction management statement is never compiled into a stored procedure, you can always use the EXECUTE IMMEDIATE command to send the statement to SQL Server via a host variable. For example, to execute SAVE TRAN MYTRAN, you can first declare a host variable "hvar", copy the string into the variable, and execute it:

   EXEC SQL BEGIN DECLARE SECTION END-EXEC
   01 hvar          pic x(80).
   EXEC SQL END DECLARE SECTION END-EXEC
   ...
   MOVE "SAVE TRAN MYTRAN" to hvar.

   EXEC SQL
      EXECUTE IMMEDIATE :hvar
   END-EXEC

STATUS

Microsoft has confirmed this to be a problem in SQL Server Embedded SQL for COBOL version 4.21. We are currently researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Additional query words: Tran
Keywords : kbbug4.21 kbprg SSrvCobol SSrvProg
Version : 4.21 | 4.21
Platform : MS-DOS OS/2


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.