Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
String is too long to fit
Message
From
06/07/1999 10:35:53
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00237705
Message ID:
00237743
Views:
18
This message has been marked as the solution to the initial question of the thread.
>Hi,
>
>I was trying to create cursor for my report using this code:
>
> FOR lni=1 to lnTableCount
> lcCommand=lcCommand+;
> "SELECT '"+laTables[lni]+"' AS TABLE,"+;
> "GROUP,FIELD_NAME,HEADER,"+;
> "ALLTRIM(DEFINITION) AS DESCR,"+;
> "FIELD_TYPE,FIELD_LEN,FIELD_DEC,FIELD_NULL,"+ ;
> laTables[lni] +" AS FIELD_ORDER FROM DATADICT WHERE "+laTables[lni]+">0 "+;
> "INTO CURSOR cur"+alltrim(str(lni))
>
> if lni=lnTableCount
> lcCommand=lcCommand+" ORDER BY 1,10"
> endif
>
> &lcCommand
>
> lcCommand="SELECT * FROM cur" +alltrim(str(lni))+" UNION "
>
> ENDFOR
>
>******************************
> Here lcTableCount=11.
> Unfortunately, on 3rd lni I have an error message "string is too long to fit". How can I resolve this?
>

Break up the statement into a series of separate selects, and rather than doing a UNION, since they all have to have the same structure for a UNION to work, simply append them together into a single cursor after the fact. This is probably the easiest mechanism to implement, and is least affected by changes in the future.

You may also be able to increase the complexity of a SQL Select statement's WHERE expression if that's the cause of your problem with SYS(3055); if the error that you're receiving is error 1308 (insufficient stack space) or 1812 (SQL statement too long) you can increase the complexity support for FOR and WHERE clauses. SYS(3055) accepts a numeric value as a second argumnet, the default is 320, and it can be set between 320 and 2040. the recommendation in the help file regarding this suggests a value 8 * number of fields involved in the target or source tables.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform