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: