Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
String is too long - revisited
Message
From
29/12/2005 15:50:01
 
 
To
29/12/2005 15:09:07
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01081786
Message ID:
01081831
Views:
9
One general approach is to create a temporary cursor with a memo field, fill that with your FixMemo() function then create a SELECT that JOINs in the cursor with the rest of the source columns.

>I need it to be a memo field in the resulting cursor or table. Can't have a memo field go into a charater field, that is the whole problem.
>
>
>>A table character field cannot be longer than 254 characters.
>>
>>FUNCTION fixmemo()
>>...
>>RETURN PADR(lcfield, 254)
>>
>>
>>>Here I go again. I have a select string:
>>>
>>>SELECT CR_ACT.NXTACT_ST, ALIASES.NAME_ALIAS, ADDRES.STATE, CR_ACT.INITING_AC, ;
>>>CR_ACT.DTE_NXTACT, CR_ACT.NXT_ACT, CONTACT.FIRST_NAME, CONTACT.LAST_NAME, ;
>>>TITLE_.DESCRIP, CONTACT.PHONE, CLIENTNM.CLIENT_ID, ;
>>>fixmemo(CR_ACT.ACTION_NOT) as action_not ;
>>>FROM CR_ACT, ALIASES, ADDRES, CONTACT, TITLE_, CLIENTNM ;
>>>WHERE ( CR_ACT.DTE_NXTACT >= CTOD("05/01/2005") .AND. ;
>>>CR_ACT.DTE_NXTACT <= CTOD("06/01/2006") ) .AND. ;
>>>.NOT. "CAN" $ RTRIM(UPPER(CLIENTNM.ACCT_STAT)) .AND. ;
>>>UPPER(ALIASES.ALIAS_TYPE) = "MAIN" .AND.  ;
>>>clientnm.client_id = "Foo" .AND. CONTACT.CLIENT_ID = CLIENTNM.CLIENT_ID .AND. ;
>>>CONTACT.CLIENT_ID = ALIASES.CLIENT_ID .AND. ;
>>>CONTACT.CLIENT_ID = ADDRES.CLIENT_ID .AND. ;
>>>CONTACT.ADDRES_TYP = ADDRES.ADDRESS_TY .AND. ;
>>>CONTACT.CLIENT_ID = CR_ACT.CLIENT_ID .AND. ;
>>>CONTACT.CONTACT_ID = CR_ACT.CONTACT_ID .AND. ;
>>>CONTACT.TITLE = TITLE_.TITLE_ ;
>>>ORDER BY 5 ASC, 2 ASC
>>>
>>>with the function:
>>>
>>>FUNCTION fixmemo()
>>>  PARAMETERS pcTablefield
>>>  LOCAL lcfield
>>>  lcfield = PADL("", 260)
>>>  DO CASE
>>>    CASE EMPTY(pcTablefield) OR ISNULL(pcTablefield)
>>>      lcfield = PADL("", 260)
>>>    CASE LEN(pcTablefield) < 256
>>>      lcfield = PADR(pcTablefield, 260)
>>>    CASE LEN(pcTablefield) > 256
>>>      lcfield = ALLTRIM(pcTablefield)
>>>  ENDCASE
>>>  RETURN lcfield
>>>ENDFUNC  && end of fixmemo()
>>>
>>>and I still get the error "string is too long"
>>>
>>>any ideas?
>>>
>>>TIA
>>>Beth
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform