Microsoft KB Archive/87310

{|
 * width="100%"|

The information in this article applies to:
 * Microsoft Embedded SQL version 4.2 for COBOL

BUG# ESQL: 7318 (4.2)

SYMPTOMS
In an Embedded SQL for COBOL application, if the declaration of a cursor contains an IN clause and you use host variables as the list values, the following error occurs when you compile the application:

Error 102: syntax error near &quot; &quot; For example, this cursor declaration causes the error: exec sql declare c cursor for select * from authors where au_id in (:id1,:id2,:id3) end-exec

CAUSE
SQL Server Embedded SQL for COBOL incorrectly parses the IN clause in a cursor declaration if you use host variables as the list values.

WORKAROUND
Because there are a finite number of host variables in the value list, you can convert the IN clause into several OR statements. For example, the query above can be converted into the following:

where au_id=:id1 OR   au_id=:id2 OR   au_id=:id3

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

-

Last reviewed: May 5, 1997

© 1998 Microsoft Corporation. All rights reserved. Terms of Use.