After doing an insert to a local MySql database, I want to log the SQL text to a file and use it later for inserting to a different ( remote) database when a connection is available.
The docs for QSqlQuery::executedQuery () say:
The placeholders in the original query are replaced with their bound values to form a new query.
But, for an insert, I see "?" for all the values :
I also tried QSqlQuery::lastQuery, but the Sql text has the placeholders, not the values:"INSERT INTO TEAM_RECORDS (event_id, race, heat, today, left_team_time, left_start_time, left_result, right_team_time, right_start_time, right_result) VALUES ( ?,?,?,?,?,?,?,?,?,?)"
Is this the intended behavior?"INSERT INTO TEAM_RECORDS (event_id, race, heat, today, left_team_time, left_start_time, left_result, right_team_time, right_start_time, right_result) VALUES ( :event_id,:race,:heat,:today,:left_team_time,:left _start_time,:left_result,:right_team_time,:right_s tart_time,:right_result)"
I can write a little code to parse the SQL returned by ::lastQuery and replace the placeholders with values from the bindValues, but thought I'd ask if I might be missing something already in the class.
Bookmarks