>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')]