Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: No support for CASE keyword??

Re: No support for CASE keyword??

From: Andrew Prosser <andrew_at_prosser1.demon.co.uk>
Date: 1998/06/20
Message-ID: <898342664.842.1.nnrp-11.9e9803d5@news.demon.co.uk>#1/1

DCMessier wrote in message
<1998062003334400.XAA29240_at_ladder03.news.aol.com>...
>I am responsible for a databsae maintenance application. We have a
 front-end
>developed in VB 5 which uses stored procedures for all data access. We
 support
>(at the present time) Microsoft SQL Server and Sybase SQL Server on the
>back-end.
>
>I was quite disappointed to learn today, while attempting to wrap-up
 testing of
>our current release, that Sybase Transact-SQL does NOT support the ANSI
 SQL-92
>standard CASE expression. Does anyone know WHY??
>
>I was very upset, and wasted lots of time coming up with a work-around for
 this
>untimely mess. Am I missing something here? Or is the only alternative to
 use
>a complicated if..else construct?
>
>It's frustrating to do primary development on MS SQL Server, with the
>expectation that Sybase will support STANDARD SQL syntax.
>
>Any suggestions out there?

Transact-SQL did not support this originally, Microsoft included it in 6.0 and Sybase has included it in 11.5, presumably you are using a lower Sybase version, if you were using MS SQL Server 4.2 it would not work either, so it depends what you call 'standard' T-SQL, as they are now different products it seems foolhardy to develop on MS and run production on Sybase. It will only get worse once 7.0 comes along, but then its your choice, cursor behaviour must also be interesting if you are using some of the MS features and new functions like isdate and isnumeric.

Overall, develop and deploy on the same platforms, or in the meantime upgrade Sybase.

Regards

--
Andrew Prosser

Sybase case

Supports conditional SQL expressions. case expressions can be used anywhere
a value expression can be used.
   case
    when search_condition then expression
    [when search_condition then expression]...
    [else expression]
end

case and values syntax:
   case expression
    when expression then expression
    [when expression then expression]...
    [else expression]
end

Microsoft case

The CASE expression allows SQL expressions to be simplified for conditional
values. The CASE expression in SQL Server 6.0 is ANSI SQL-92-compliant and
allowed anywhere an expression is used.
Syntax
Simple CASE expression:
CASE expression
 WHEN expression1 THEN expression1
 [[WHEN expression2 THEN expression2] [...]]
 [ELSE expressionN]
END
Searched CASE expression:
CASE
 WHEN Boolean_expression1 THEN expression1
 [[WHEN Boolean_expression2 THEN expression2] [...]]
 [ELSE expressionN]
END
Received on Sat Jun 20 1998 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US