Scenario: In a previous Test sermon, a colleague directly generated an INSERT statement using NAVICAT from the lookup results, supporting the batch generation of statements.
Application scenarios: Automation, performance testing initialization data . Directly from the existing library to query the required data content, and then generate the corresponding INSERT statement, inserted into the corresponding test target database, reduce the manual hand into the data redundant work and the wrong operation of the guide table.
Tool Requirements: Navicat 11.0.18 (old version does not seem to have this feature)
Steps:
- Write the SQL script that you want to export, run the query
- In the resulting results, select the rows you want to export (support CTRL, SHIFT key functions)
- When the result is selected, right-click to select "Copy as"--"insert statement" at the selected row position. At this point, the corresponding insert has been copied.
This method can also generate an update statement directly
MySQL generates INSERT, UPDATE statements based on query results