On Sat, Oct 14, 2000 at 01:05:05PM -0700, Mark Polsen wrote:
Error: Column count doesn't match value count at row 1
query << "insert into %5:table values (%0q, %1q, %2q, %3q, %4q)";
query.parse();
query.def["table"] = "testtable";
query.execute (2, 4, 6, 8, 1);
Hi
IMHO this has nothing to do with mysql++, but with the mysql sql syntax.
Since you only specify the field VALUES in you query, mysql assumes you
mean first_column = first_value, second_column=second_value,.....
To make this work, you have to explicity name the columns in your query, e.g
query << "insert into %5:table set col1=%0q, col2=%1q, col3=%3q,.... ;" ;
...
...
...
Of course, this makes your query less generic.
mfg, Florian Pflug