I have really hit a wall here, so I’ve finally given up figuring this out myself and decided to ask here.
This is for work. Basically I need to insert (append) a large number of identical records in a table. At the moment this is (roughly) how I do it using VBA/SQL:
(counter and total are integers, wordtoinsert is the word I need inserted, which I get from a separate function)
Do while counter < total
Docmd.runsql “insert into mytable (field1) select “ & wordtoinsert
Counter = counter + 1
(not the actual code which I don’t have available right now so don’t worry about correcting any typing mistakes)
Now, this works fine as such, however, as “total” can be quite large (anywhere from 10 to around 10,000 really) it is rather slow, especially since I process hundreds of records at a time.
Is there a faster way to do this? I’ve been trying to find a way to insert many records at once rather than inserting one record many times but so far I’ve come up blanks. If anybody has any ideas I’d be reeeeally grateful.
Obviously it's not useless data - otherwise I wouldn't be doing it
If you must know, we work with languages and consequently work with some absurdly large corpora and wordlists in over 40 different languages, which we can currently only access and modify via Access. Occasionally we need to increase the frequency of various words (for reasons I won't get into here) - as in literally adding x number of the words in question.
So far we've been doing it manually
Anyways, thanks a lot pootle flump, that works a treat. Should speed things up a lot.