I'm building an export application to run against a table with about 20,000 rows. Each row needs to be written to the output file, then the row will be marked by changing the "exported" column from default 'N' to 'Y' so that we know which rows have been exported.
The idea of running 20,000 update queries makes me itch, so I was thinking along the lines of using a single query with a clause like WHERE id IN (1,2,3,4,5 ... 20000)
It seems like this query string might be nearly 100,000 characters.
Is there a practical limit on the length of the query string? Or any other "gotcha" lurking in this idea?
Is there a "best practice" way of doing something like this?
Response time is not a big issue; this will probably run once a day.
Thanks and regards, ~Ray