I have to put tons of integers and floats into a mysql database from a c application.
Currently I am doing this by converting all those values into a string and then transfering them to the database:
char * sql_query[2048];
sprintf(sql_query, "INSERT INTO my_table VALUES (%u, %u, %d, %.7f, %u, .....");
if (mysql_real_query(&mysql, sql_query, strlen(sql_query)) {
fprintf(stderr, "SQL Request failed: Error: %s\n", mysql_error(&mysql));
}
As this way is quite time consuming: Isn't there a way to avoid a conversion to string which needs to be interpreted and converted back by mysql. I'm looking for a binary API, which directly swallows my variables. Does that exist?