Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FYI; Problem with PADL; .NULL. in SELECT SQL
Message
 
 
To
23/06/2009 23:46:17
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01407500
Message ID:
01407967
Views:
56
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform