Incorrect SQL statement syntax near: WITH

0 Likes
over 5 years ago

Problem:

The following complex query compiles fine in Net Express:

   EXEC SQL
      DECLARE cursor0 CURSOR FOR

      SELECT col1, col2,
      CASE WHEN ...
         THEN (SELECT COUNT(*) FROM table1 WHERE ...)
         ELSE (SELECT COUNT(*) FROM table1 WHERE...
            AND EXISTS (SELECT * FROM table2 WITH (NOLOCK) WHERE ...)) END,              CASE WHEN ... END
      FROM Table0

   END-EXEC.

When compiling the above in Visual COBOL 2.3 for Visual Studio, the following error occurs:

COBES0100 : Incorrect SQL statement syntax near: WITH

Resolution:

The issue has already been addressed in Visual COBOL 2.3 Hotfix1 that is available at the Product Updates page of the Micro Focus SupportLine site.

The fix is also included in the upcoming release of Visual COBOL 2.3 Update 1.

Comment List
Anonymous
Related Discussions
Recommended