BUG: ESQL: IN Clause in Cursor Causes ErrorLast reviewed: May 5, 1997Article ID: Q87310 |
The information in this article applies to:
SYMPTOMSIn 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 "<cursor name>"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 CAUSESQL Server Embedded SQL for COBOL incorrectly parses the IN clause in a cursor declaration if you use host variables as the list values.
WORKAROUNDBecause 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 STATUSMicrosoft 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.
|
Additional query words:
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |