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