Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FYI; Problem with PADL; .NULL. in SELECT SQL
Message
De
22/06/2009 06:56:21
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
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:
01407504
Vues:
56
>With one table query, VFP uses the first physical record to determine the size of the fields in the result set. However, the result looks like a bug to me. PADR(i1,11) should have created C(11) field in the result even for the NULL value.

I run into this problem in a SELECT with an inner join.

And, yes PADR(.NULL.,11) returns '.NULL. '

But the SQL will set it to c(1). Other trimmings of PADR like PADR(...,...',_') will fail to. The browse will look like it holds eleven chars (SPACE in anny way), DISPLAY STRU returns c(1)

.
>
>>
>>this is for your information, you might confirm as well.
>>
>>Version mentioned is just the highest, I can follow the problem down to VFP 7.0
>>
>>Following construct:
>>
>>CREATE CURSOR curTest (i1 I NULL)
>>
>>INSERT INTO curTest VALUES (.NULL.)
>>delete
>>INSERT INTO curTest VALUES (1)
>>INSERT INTO curTest VALUES (20)
>>
>>SELECT PADR(i1,11) FROM curTest
>>
>>Result is
>>
>>1
>>2
>>
>>Table structure of result shows that the result contains one char field of lenght 1 (instead of 11)
>>
>>Some experiments with WHERE, NVL, JOIN allways return the same.
>>
>>It does not matter if the record is deleted or not, only factor is that it is the first one.
>>
>>Update
>>Other approaches like CAST or BINTOC will solve my problem (I need a character version of a interger surrogate key for a combobox)
>>
>>Agnes
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform