Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using command literal gets 'string too long to fit' erro
Message
From
09/04/2002 13:41:14
 
 
To
01/04/2002 15:19:44
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00639649
Message ID:
00642784
Views:
7
Instead of putting the whole statement into 1 string, put it into 2 or three portions:

Try:
local lcTables, lcFilters
lcTables = [mytables]
lcFilter = [myfilters]

select &lcTables where &lcFilters



>I have mySQLString to hold the SQL SELECT statement that the user builts. mySQLString varies in length, depending on what user wants. Sometimes this string can grow really long (user selects many fields, many filters & sort order). Once mySQLString is built, I use &mySQLString to execute the SELECT Statement built in mySQLString.
>
>Example:
>mySQLString='SELECT * FROM myTable'
>&mySQLString
>
>This works fine if mySQLString is of reasonable length. But when it gets very lengthy, I get 'String too long to fit' error (user can customize mySQLString so that mySQLString changes all the time). I've read somewhere that the max. length of command literal is 8000 bytes. How do I get around this?
>
>Thanks all!
Bill Morris
Previous
Reply
Map
View

Click here to load this message in the networking platform