It appears your question is a matter of understanding.
1 SQL is Structured Query Language, intended for manipulating data in a database (ie. tables and columns). It is not a scripting language (eg./bin/sh, perl) or a programming language (eg. C). The CASE statement is implemented in the context of SQL, ie. it operates in the context of a column value (the examples in the manuals are quite good) in a SELECT, not in the context of a variable as in a programming language. It eases the handling or denormalised or unnormalised tables or raw imported files. A simple example:
(you can make it quite complex and dependent on other columns, etc, refer doco)
WHEN "A" THEN "Fat"
WHEN "B" THEN "Thin"
2 There is no 'limitation' in Sybases SQL CASE implementation, the error is not in the implementation, it is in your assumed concept of what CASE does. In fact it is what we asked for, with far more flexibility than (eg.) MS implementation. It is not intended to support the C case function, if you want that, simply use a series of IF statements.
Last edited by DerekA; 09-24-02 at 00:24.
Senior Sybase DBA/Information Architect derekATsoftwaregemsDOTcomDOTau
Anything worth doing is worth doing Right The First Time
Spend your money on standards-compliant development or spend 10 times more fixing it