Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update statement doesn't let me Update MEMO > 254 char
Message
From
22/01/2003 16:54:33
 
 
To
22/01/2003 16:16:56
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00744491
Message ID:
00744511
Views:
22
>I have a DBC that contains a table that has memo fields.
>
>I create a character string that contains the UPDATE statement that will update the memo field. Then I evaluate the char string. If the memo field is loaded less that 255 char it works - but if it is larger than 255 it fails.
>
>This is driving me nuts - what's wrong here...
>
>The char string looks OK in every way.
>-------------------------------------------------
>ex: t = long string over 250 characters
>
>** following doesn't work when I issue &CSQL_MESS
>csql_mess = [update orgv_hist set change_request = change_request + '] + t + ['] + [ where timestamp = ctot('22/01/2003 03:16:00 PM')]
>
>** following DOES work when I issue &CSQL_MESS
>csql_mess = [update orgv_hist set change_request = change_request + '] + left(t,250) + ['] + [ where timestamp = ctot('22/01/2003 03:16:00 PM')]
>
>change_request field is a memo
>Am I going nuts or what....

A quoted string can't be longer than 254 characters (which is what you've got when you put the contents of your "t" variable between the single quotation marks). You'll need to break your "t" variable up into multiple parts and add the parts to the value:

t1 = LEFT(t,250)
t2 = SUBSTR(t,251,250)
t3 = SUBSTR(t,501,250) etc., etc.

csql_mess = [update orgv_hist set change_request = change_request + '] + t1 + ['+'] + t2 + ['] + [ where timestamp = ctot('22/01/2003 03:16:00 PM')]
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform