Re: Trying to use the case command in a select statement from a C program

From: Joe Maloney <mpir_at_bellsouth.net>
Date: 30 Jul 2001 09:08:41 -0700
Message-ID: <d17bad25.0107300808.5c4b5c36_at_posting.google.com>


Peter Martin <petem1030_at_home.com> wrote in message news:<q986mtgivfpnhspeqi47nd6432dlkid2m9_at_4ax.com>...
> I tried to use the new case statement in a C program and I got an
> error. Does the compiler support this statement?

Which version of Oracle? CASE is not supported in SQL until O9i (the latest and greatest.......)

Prior to 9, you need to use a DECODE Function in a SQL statement (or if/elseif/end in PL/SQL).

To technically respond to your question, C uses a 'switch' statement that better be supported by your compiler. Therefore, it supports the case structure, but not CASE syntax. BUT, SQL is processed by a pre-compiler called PRO*C, which converts the SQL to C, which is then processed by your compiler. I haven't worked with O9i PRO*C, but I presume it would support the case structure. Received on Mon Jul 30 2001 - 18:08:41 CEST

Original text of this message