Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update statement doesn't let me Update MEMO > 254 char
Message
De
22/01/2003 16:54:33
 
 
À
22/01/2003 16:16:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00744491
Message ID:
00744511
Vues:
23
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform