Desmond Lloyd wrote on 2012-04-17: 
>  Good Morning All,
>  
>  This piece of code has worked for ages.  Now all of a sudden I am
>  getting a "String too long to fit" error.  Broke the union all into
>  three different cursors,  the first two are fine,  the third errors
>  out?
>  
>  Does anyone see anything blatantly wrong that would throw this error....
>  
>  Regards,
>  Desmond
>  
>  select womast01.step,stepcode.tbldesc as
>  step_desc,womast01.sub_step,subCodes.tbldesc as sub_desc,000000 as
>  sDays,womast01.wono,womast01.dept,womast01.item,womast01.engine,womast01
>  .recdate,womast01.estdate as commit,womast01.location, ;
>               womast01.descrip,arcust01.company,womast01.reqdate,date() -
>  womast01.recdate as house_days,alltrim(complaint) as
>  txt_comp,workreq,space(254) as wo_note from
>  womast01,stepcode,subcodes,arcust01 where womast01.step = stepcode.code
>  and womast01.sub_step = subcodes.code and ;
womast01.custno =
>  arcust01.custno and womast01.step = '22' and womast01.sub_step # '22' 
>  and womast01.status # 'H'  into cursor hold1 *union all select
>  womast01.step,stepcode.tbldesc as
>  step_desc,womast01.sub_step,subCodes.tbldesc as sub_desc,000000 as
>  sDays,womast01.wono,womast01.dept,womast01.item,womast01.engine,womast01
>  .recdate,womast01.estdate as commit,womast01.location, ;
>               womast01.descrip,arcust01.company,womast01.reqdate,date() -
>  womast01.recdate as house_days,alltrim(complaint) as txt_comp,workreq
>  ,space(254) as wo_note from womast01,stepcode,subcodes,arcust01 where
>  womast01.step = stepcode.code and womast01.sub_step = subcodes.code and
>  ;                    womast01.custno = arcust01.custno and
womast01.sub_step = '22' and
>  womast01.step # '22' and womast01.status # 'H'  into cursor hold2
>  *union all
>>>>>>>>>> BLOWS U HERE <<<<<<<<<<<<< 8-(
> 
>  select womast01.step,stepcode.tbldesc as
>  step_desc,womast01.sub_step,subCodes.tbldesc as sub_desc,000000 as
>  sDays,womast01.wono,womast01.dept,womast01.item,womast01.engine,womast01
>  .recdate,womast01.estdate as commit,womast01.location, ;
>               womast01.descrip,arcust01.company,womast01.reqdate,date() -
>  womast01.recdate as house_days,alltrim(complaint) as
>  txt_comp,workreq,space(254) as wo_note from
>  womast01,stepcode,subcodes,arcust01 where womast01.step = stepcode.code
>  and womast01.sub_step = subcodes.code and ;
womast01.custno =
>  arcust01.custno and womast01.sub_step = '22' and womast01.step = '22'
>  and womast01.status # 'H' into cursor hold3

Desmond,

The txt_comp field is set to ALLTRIM in the cursors. The first record sets
the length. 
I suggest you PADR() then ALLTRIM it later, or possibly cast to a varchar()
[requires VFP 9].

Tracy Pearson
PowerChurch Software


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to