I'd be tempted to consider keeping the codes in a table and just using a subquery for the condition. It would be pretty flexible, wouldn't have the limitations of a string and the subset of codes could be parameterized in whatever way necessary and the cursor used for the subquery.
I realize the string may be being produced someplace where that is a problem, but you could have a vfp function or a udf that would return it as a cursor in either case and use
>>>Right, but I want to have something which I can use without changes in both SQL and VFP. Also I just found I can not use INLIST, I have more than 24 codes.
>>
>>I don't think you'll be able to write something that will work on both databases. At least not something reasonably simple and maintainable.
>
>I can with the UNION, but I decided to go against this idea. I can use placeholder and do update on my cursor afterwords, or update the rest of the code to use the check directly against this string.
Charles Hankey
Though a good deal is too strange to be believed, nothing is too strange to have happened.
- Thomas Hardy
Half the harm that is done in this world is due to people who want to feel important. They don't mean to do harm-- but the harm does not interest them. Or they do not see it, or they justify it because they are absorbed in the endless struggle to think well of themselves.
-- T. S. Eliot
Democracy is two wolves and a sheep voting on what to have for lunch.
Liberty is a well-armed sheep contesting the vote.
- Ben Franklin
Pardon him, Theodotus. He is a barbarian, and thinks that the customs of his tribe and island are the laws of nature.