Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Memo fields in SQL-SELECT statements
Message
De
22/09/1997 15:27:03
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00051069
Message ID:
00051091
Vues:
43
>>To avoid NULL values in my cursors, I use something like SELECT NVL(MyField,space(len(MyField))). From what I understand, the first record in a SELECT statement determines the field's width. Since memo fields are of varying length, how do I select a memo field without getting a possible NULL value? i.e. SELECT NVL(MyMemoField,space(???))
>>
>>Thanks
>>Elyse
>
>How about:
>
>SELECT MAX(LEN(ALLTRIM(MyMemoField))) AS maxlen INTO CURSOR memolen
>lnMaxLen = memolen.maxlen
>USE IN memolen
>SELECT NVL(MyMemoField, SPACE(lnMaxLen)) ...
>
>
>HTH

One more improvement to avoid SQL error:
lnMaxLen = MIN(memolen.maxlen,254)
Edward Pikman
Independent Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform