# BUG: ESQL: Level 49 Group Items Not Work on INSERT Statements

Last reviewed: May 5, 1997
Article ID: Q105325

The information in this article applies to:

- Microsoft Embedded SQL version 4.21 for COBOL

BUG# 9441 (4.21)

## SYMPTOMS

In Embedded SQL (ESQL) for COBOL, variable length character strings can be declared as group items containing only two elementary items, both of which must have level number 49, as follows:

       01  test.
             49   test-len   pic 9(4) comp-5
             49   test-data  pic x(100).

The host variable group test can be used as a single variable with test-len holding the length of the varchar string, and test-data has the actual string.

This works fine with SELECT statements, but does not work with INSERT or update statements.

When trying to use the group variable with insert, for example:

       insert t values (:test)

where t is a table with a single column of type varchar, the value inserted in the varchar column will be ASCII character of the value in test-len, not the actual character data in test-data.

## CAUSE

SQL Server Embedded SQL for COBOL incorrectly handles these special group items with INSERT or update statements.

## WORKAROUND

Use elementary items instead of the group items when working with INSERT or update statements in Embedded SQL applications.

## STATUS

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

> Additional query words:
> Keywords : kbbug4.20a kbbug4.21 kbprg 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: May 5, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.