Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query remote data
Message
 
To
15/09/2005 17:52:51
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
01050017
Message ID:
01050221
Views:
7
Roman,

Since you'd be building the string in many passes, the 254 limit won't affect you. What will affect you is if it exceeds 8000 characters. If you suspect that will be the case, then your concatenation routine would need to check the length of the string and break it into multiple 8000 byte strings. Then, if you decided to use a stored proc, just add more parameters. Something like this:
LOCAL lcIDs as String, ;
      lcSQL as String

lcIDs = '0'

SCAN FOR IsSelected = 1
  lcIDs = lcIDs + ','
ENDSCAN

TEXT TO lcSQL NOSHOW TEXTMERGE PRETEXT 15
  SELECT *
    FROM someTable
    WHERE pkValue IN (<<lcIDs>>)
    ORDER BY someField
ENDTEXT

SQLEXEC(handle, lcSQL, 'curResult')
If you want to create a stored proc for the query, the TEXT/ENDTEXT would need to change to something like this:
TEXT TO lcSQL NOSHOW TEXTMERGE PRETEXT 15
  someStoredProcedure '<<lcIDs>>'
ENDTEXT
HTH,
Chad

>What if user selects too many choices and SQL string exceeds 254?
_________________________________
There are 2 types of people in the world:
    Those who need closure
Previous
Reply
Map
View

Click here to load this message in the networking platform