Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FYI; Problem with PADL; .NULL. in SELECT SQL
Message
 
 
À
23/06/2009 23:46:17
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 SP2
Divers
Thread ID:
01407500
Message ID:
01407967
Vues:
55
Hi Frank,


>any function of a NULL returns NULL.

The correct statement would be, "Any function of a NULL should return NULL". I don't think it's always the case in VFP but it's irrelevant in this case.

> That is not a bug, as I understand the matter.

The bug is not that PADR(NULL, nn) returns NULL but that VFP incorrectly calculates the size of the field in the resulting record set in this case.

> CAST seems to have special powers: I'm not sure this is a good thing (NVL, or ISNULL in T-SQL, should be used in the SELECT, IMHO).

You seems to be confused about issue. The CAST(NULL AS C(nn)) does return NULL as it suppose to and also creates a column/field of appropriate type because in the world of SQL everything has type.
The CAST() is preferable function to use in a query. It was designed with such use in mind and for compatibility with SQL Server.

> As Chris Date has spent quite a bit of energy explaining, NULL is not a value, and should never be able to function as a value.

And it's relevant here how?
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform