Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Memo fields in SQL-SELECT statements
Message
From
22/09/1997 15:27:03
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00051069
Message ID:
00051091
Views:
37
>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform