Spec-Zone .ru
спецификации, руководства, описания, API

26.2. Edit MySQL Data

MySQL for Excel enables you to load and edit MySQL data directly from Microsoft Excel. Changes are immediately committed if the Auto-Commit option is enabled, or done manually by pressing Commit Changes.

Note

The Edit MySQL Data feature exists as of MySQL for Excel 1.1.0.

The example below uses the category table of the example sakila database, but the screen will look the same for any table. Within MySQL for Excel, Open a MySQL Connection, click the sakila schema, Next, select the category table, click Edit MySQL Data, then choose Import to import the data into a new Microsoft Excel worksheet for editing.

Figure 26.2. Editing table data with MySQL for Excel

Editing table data with MySQL for Excel

The background color represents the status of each cell, and there are four distinct colors that are used while editing table data:

Table 26.1. Background cell colors

Color Description
White Default color for all cells. This is either the original data, or the data after Refresh from DB is clicked.
Blue Cells that were committed with success.
Green Cells that were modified but have not yet been committed.
Red Cells that generated an error when a commit was attempted. An error dialog is also displayed while the commit is attempted.
Yellow Cells that accept new data. Data entered here is inserted into the MySQLtable.

In our example, the blue "Drama" field was changed and then committed first, then the green "Gaming" field was changed but not committed, and then Auto-Commit was enabled before changing the "9" to a "10" in column 10, which generated an error because this commit would have added a duplicate value as primary key.