Oracle CASE statement precompile error in Micro Focus



We are converting our COBOL from DB2 to Oracle (also IBM z/OS to Micro
Focus Server Express on Linux) but have run into an Oracle precompile
issue: Two cursors that use the CASE statement in DB2. While I
believe the CASE statement is not ANSI SQL, Oracle's documentation
suggests it also supports (since 8i) the CASE statement in what appears
to be the nearly the same format as DB2.

To test that the error was due to the precompiler (and not the large
complex cursor), I created a small, simple cursor:

EXEC SQL
DECLARE TEST_CURS CURSOR WITH HOLD FOR
SELECT 'TESTING'
, CASE
WHEN (7 > 5)
THEN 'TRUE'
ELSE 'FALSE'
END AS TEST_VAL
FROM DUAL
END-EXEC.

However, when I precompile the COBOL program in Server Express with
Oracle 10g, I get the following error suggesting an issue with the
"WHEN" clause of the CASE statement:


606 EXEC SQL
607 DECLARE TEST_CURS CURSOR WITH HOLD FOR
608 SELECT 'TESTING'
609 , CASE
Error at line 610, column 30 in file testprog.sks
610 WHEN (7 > 5)
610 .............................1
610 PCB-S-00400, Encountered the symbol "(" when expecting one of
the following:

, INTO FROM

611 THEN 'TRUE'
612 ELSE 'FALSE'
613 END AS TEST_VAL
^LPro*COBOL: Release 10.1.0.2.0 - Production on Tue Jul 26 16:29:16
2005

Copyright (c) 1982, 2004, Oracle. All rights reserved.

614 FROM DUAL
615 END-EXEC.



I also tried it without the enclosing parentheses, but with no luck.
The error simply points to the "7" instead.

I appreciate any help someone could provide on the topic and thanks in
advance.

Thanks,
Craig

.



Relevant Pages

  • Re: How to determine database market share?
    ... with your meaningful contributions to to .oracle lists over the time ... It was not "Something about measuring database market penetration by ... > On the DB2 side, many of the people who are DB2 DBA's have been doing ... > On the SQL Server side, there are 2 questions involved, how many real ...
    (comp.databases.oracle.server)
  • Re: Migrating to Oracle on Windows
    ... I am looking into migrating a database from DB2 on z/OS to Oracle ... essentially no excuse for moving to Windows, ... The example I gave of migrating from DB2 on z/OS to Oracle on Windows ...
    (comp.databases.oracle.server)
  • Re: Adjusting to DB2
    ... I guess "tier 1" is the escape clause which means that Oracle is not available on all platforms at the same time when a new release or fixpack is made available. ... DB2 for Linux, UNIX, and Windows is always simultaneously available for Every release and every fixpack on all it's supported platforms. ... Ports to new platforms (e.g. if IBM decided to support Apple) are possible within a few weeks and can occur at a servicepack level. ...
    (comp.databases.oracle.server)
  • Re: Would Oracle be considered?
    ... Thats good for Oracle users, but personally I wouldn't touch Oracle with a 10 foot pole. ... I think, there is no other database with such performance, scalability and security features. ... IBM last week announced a free version of its DB2 database aimed at attracting application developers who might have ... DB2 Express-C is available to customers and developers as a free download, ...
    (borland.public.delphi.non-technical)
  • Re: Adjusting to DB2
    ... And that you are unfamiliar with many of the DB2 ... It is even more interesting that Oracle IS a single code ... > I prefer to tune all the SQL before it goes into production. ...
    (comp.databases.oracle.server)