insert or ignore
Posted: Wed 11 Dec 2013 23:49
I am inserting a large number of records into a database 1000 at a time within a transaction using
UniQuery->Append();
...
UniQuery->Post()
I am using UniQuery->FieldByName(...) as a few of the fields are largeish blobs
One of the fields should contain unique values and has a unique constraint and I want to use the equivalent of INSERT OR IGNORE.
Is there an easy way to go about this. At the moment I am inserting all of the rows and thende-duplicating, which I expect is slower than it could be. I expect that there are better was of doing this.
UniQuery->Append();
...
UniQuery->Post()
I am using UniQuery->FieldByName(...) as a few of the fields are largeish blobs
One of the fields should contain unique values and has a unique constraint and I want to use the equivalent of INSERT OR IGNORE.
Is there an easy way to go about this. At the moment I am inserting all of the rows and thende-duplicating, which I expect is slower than it could be. I expect that there are better was of doing this.