Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG: COUNT(ICASE(exp,) without eOtherwiseResult!
Message
De
16/04/2005 18:28:53
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01005497
Message ID:
01005510
Vues:
20
>Fabio,
>
>It looks like a bug to me too.
>Another observation. According to ICASE() help the following 2 statements are similar but the second one generates an error. They both generate an error w/o COUNT()
>SELECT COUNT(ICASE(.F.,1)) FROM RUNROWS INTO CURSOR c2
>SELECT COUNT(ICASE(.F.,1, Null)) FROM RUNROWS INTO CURSOR c2
>
>

Infact, this is another effect of this bug.

But on the second VFP fire a error,
because it want a defined datatype for the COUNT() expression,
but this is another bug because COUNT() don't use the datatype,
is use only the NULL and NOT NULL values,
the result ( integer ) is defined in any cases.

If the exp must to have a datatype,
what is the "*" datatype ?

Example, this fire a error:
SELECT COUNT(NULL) FROM RUNROWS
but this don't fire a error ( count 1 numeric an 500 strings ),
It is correct,
because the not nullable values are 501:
CLEAR

CREATE CURSOR RUNROWS (F1 L)
INSERT INTO RUNROWS VALUES(.T.)
FOR K=1 TO 500
	APPEND BLANK
NEXT
SELECT COUNT(IIF(F1,1000,'CHAR')) FROM RUNROWS
RETURN
This bad design is present into MS SQL too. Sin.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform