mysqlpp's (Tangensoft) insertfrom with ON DUPLICATE KEY UPDATE

23 views Asked by At

I searched a lot in the docs, but can't find an example or explanation upon the (detailed!) usage of Query::InsertPolicy in conjunction to the mass insertion function "insertfrom()". It just seems to limit things like packet size or likewise, but how can I get a large insert (greater then 1MB) with about 15000 rows to have an ON DUPLICATE KEY UPDATE ... working?

I only find options for chopping the INSERT statement into smaller chunks, but the command always seems to be INSERT (...) VALUES (...) What I need is an insertfrom() call for INSERT (...) VALUES (...) ON DUPLICATE KEY UPDATE ...

Can someone give me a push in the right direction?

^5 Synopsis

expectation: mysqlpp's insertfrom() to use ON DULPICATE KEY

//edit: ... don't like the idea of puzzling together several "INSERT ... ON DUP KEY UPDATE" strings, limited each to 1MB and simply executing them, as it probably creates a lot of overhead in network and server.

//edit2: WARNING: mysqlpp's mega macros "sql_create_xy(...)" are not able to be used in header files as they already instanciate some things, that the final linking will complain about being instanciated muliple times when used in headers. This in conjuction with gcc's lack of will to allow explicit template specification outside of namespaces (espc. NOT in class def's) renders a great problem, forcing one to code the complete template implementations in the header files, where the req'ed structures made by sql_create_xy() can't be made available :-(((

0

There are 0 answers