Home > Archive > SQL Anywhere ultralite > May 2005 > select case error









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author select case error
Priyesh

2005-05-25, 8:23 pm

Environment: UL on pocket pc.
I have a table master_data with field fun having the following distinct
values: 'N/C', 'INC', 'DEC' and 'OFF'

Below are query results on the table for different sql statements using
select case.

1. select distinct case fun when 'N/C' then 'No Change' when 'INC' then
'Increment' when 'DEC' then 'Decrement' else 'OFF' end as k from
master_data - Returns error -134 (feature not implemented?)

2. select distinct case fun when 'N/C' then 'No Change' else 'OFF' end as k
from master_data - Returns {'No Change', 'No Change'}

3. select distinct fun k from master_data - Returns {DEC, INC, N/C, OFF}

Why would the second SQL statement execute without errors (although result
is wrong)?

TIA
Priyesh


Greg Fenton

2005-05-27, 3:23 am

Priyesh wrote:
> Environment: UL on pocket pc.
>
> 1. select distinct case fun when 'N/C' then 'No Change' when 'INC' then
> 'Increment' when 'DEC' then 'Decrement' else 'OFF' end as k from
> master_data - Returns error -134 (feature not implemented?)
>



Which version and build number of SQLAnywhere are you using (e.g. use
the command "dbeng9 -v" for SQLAnywhere 9.x)?

What happens if you remove the DISTINCT clause from the above query?

greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
Priyesh

2005-05-27, 11:23 am

Here's the version information:

---------------------------
Product version
---------------------------
9.0.2.2451
---------------------------
OK
---------------------------

When i remove DISTINCT, the query executes without problems.

Note: The following query seems to execute without errors but gives me an
incorrect result set. (I have 4 disctinct items in the table) "select
distinct case fun when 'N/C' then 'No Change' else 'OFF' end k from
master_data" will give me (No Change, No Change). The first few records in
the result set of select fun from master_data is N/C.

Thanks for your reply.



"Greg Fenton" <greg. fenton_NOSPAM_@ianyw
here.com> wrote in message
news:42968434$1@foru
ms-2-dub...
> Priyesh wrote:
>
>
> Which version and build number of SQLAnywhere are you using (e.g. use the
> command "dbeng9 -v" for SQLAnywhere 9.x)?
>
> What happens if you remove the DISTINCT clause from the above query?
>
> greg.fenton
> --
> Greg Fenton
> Consultant, Solution Services, iAnywhere Solutions
> --------
> Visit the iAnywhere Solutions Developer Community
> Whitepapers, TechDocs, Downloads
> http://www.ianywhere.com/developer/



Michael Thode

2005-05-27, 1:23 pm

It looks like this is a bug. Please open a case with tech support.

Mike

"Priyesh" <priyesh@donotreply.com> wrote in message
news:429748b0$1@foru
ms-1-dub...
> Here's the version information:
>
> ---------------------------
> Product version
> ---------------------------
> 9.0.2.2451
> ---------------------------
> OK
> ---------------------------
>
> When i remove DISTINCT, the query executes without problems.
>
> Note: The following query seems to execute without errors but gives me an
> incorrect result set. (I have 4 disctinct items in the table) "select
> distinct case fun when 'N/C' then 'No Change' else 'OFF' end k from
> master_data" will give me (No Change, No Change). The first few records in
> the result set of select fun from master_data is N/C.
>
> Thanks for your reply.
>
>
>
> "Greg Fenton" <greg. fenton_NOSPAM_@ianyw
here.com> wrote in message
> news:42968434$1@foru
ms-2-dub...
the[color=darkred]
>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com