All Products
Search
Document Center

:Manage table data

Last Updated:Jan 03, 2023

Log on to OceanBase Developer Center (ODC) and click the name of the target connection to go to the corresponding connection management page. You can click Table in the left-side navigation pane to get a list of tables. Double-click the name of a table in the table list to go to the table management page. Click the Data button in the navigation bar on the top of the page to go to the Data tab, where you can view, add, modify, and delete table data.

Important

In ODC, connections to the same database share the same session. In ODC V2.3.2 and later versions, auto-commit is turned off by default in Oracle mode, so you need to manually commit transactions. You can modify the value of the autocommit parameter on the Session Properties page to change this setting. For more information, see Session management.

Image 535

View data

On the Data tab, ODC displays data in the form of a table. The navigation bar provides the following buttons for you to view and manage the data:

Button

Description

Enable Editing

Click this button to enable the editing mode so that you can edit the data in the table.

Commit (Oracle mode)

Auto-commit is turned off by default in Oracle mode, so you need to click this button to commit the current transaction. After you click this button, a dialog box appears, indicating that the current connection uses a shared session and the commit will apply to all windows. Click Yes to apply the commit. In MySQL mode, auto-commit is turned on by default, so this button is not displayed.

Rollback (Oracle mode)

Auto-commit is turned off by default in Oracle mode. You can click this button to roll back the current transaction. After you click this button, a dialog box appears, indicating that the current connection uses a shared session and the rollback will apply to all windows. Click Yes to apply the rollback. In MySQL mode, auto-commit is turned on by default, so this button is not displayed.

Download Data

You can export the query results to a CSV, SQL, or Excel file.

  • To export the query results to an SQL file: Edit the SQL statements in the SQL Query field, specify Maximum Number of Lines in Result Set, File Name, File Format (SQL), File Encoding, Data Desensitization, and SQL File Settings (Table Name ).

  • To export the query results to a CSV file: Edit the SQL statements in the SQL Query field, specify Maximum Number of Lines in Result Set, File Name, File Format, File Encoding, and Data Desensitization. In the CSV File Settings section, specify Include the Column Header, Convert the Empty Character String into a Null Value, Field Separator, Text Identifier, and Line Break Symbol.

  • To export the query results to an EXCEL file: Edit the SQL statements in the SQL Query field, specify Maximum Number of Lines in Result Set, File Name, File Format,File Encoding, and Data Desensitization. In the Excel File Settings section, specify Include the Column Header and Export SQL statements to another sheet.

Note
  • You can desensitize the exported data. You can specify a custom number of rows to export as needed.

  • If you export data in CSV format, the exported CSV file can be opened by Microsoft Excel.

  • If you export data in XLS format, you can specify whether to include the column header and whether to export the SQL statements of the query.

Mock Data

Click this button to mock data in the table. For more information, see Data mocking.

Back to Start

Click this button to jump to the first page.

Previous

Click this button to go to the previous page.

Next

Click this button to go to the next page.

Jump to Bottom

Click this button to jump to the last page.

Display Data Volume

Click this button to set the maximum number of rows to be displayed on a page.

Search

Enter a keyword in the search box to search for the table data.

Columns

Click this button to select the columns to be displayed on the page.

Column Mode

Click this button to display the data in the selected rows in the form of a table. On the Column Mode page, you can switch to the previous or next row. The column mode makes it easier to view data in a row that has many columns.

Refresh

Click this button to refresh the data in the table.

Export

Click this button to export the data in the table. You can specify the type of the exported file, the character set, and the number of rows to be exported. The file type can be CSV or SQL, and the character set can be GBK or UTF8. You can export up to 10,000 rows from a result set.

Edit data

Click Enable Editing in the navigation bar on the Data tab to enter the editing mode, as shown in the following figure. ODC use different colors to mark data in different states. New data is marked in green, deleted data in red, and modified data in orange.

Image 534

In editing mode, the navigation bar provides the following buttons for you to edit data in the table:

Button

Description

Add Row

Click this button to insert an empty row to the table. Double-click a cell to insert data to it. ODC provides the verification feature and related tools to help you insert data in a more convenient way. For example, if the current cell is of the date type, ODC displays a calendar for you to select the to-be-inserted date from.

Delete Row

Click this button to delete the selected rows from the table.

Copy Current Row

Click this button to copy the selected rows in the table.

Back to Start

Click this button to jump to the first page.

Previous

Click this button to go to the previous page.

Next

Click this button to go to the next page.

Jump to Bottom

Click this button to jump to the last page.

Display Data Volume

Click this button to set the maximum number of rows to be displayed on a page.

Search

Enter a keyword in the search box to search for the table data.

Columns

Click this button to select the columns to be displayed on the page.

Column Mode

Click this button to display the data in the selected rows in the form of a table. On the Column Mode page, you can switch to the previous or next row. The column mode makes it easier to view data in a row that has many columns.

Cancel

Click this button to exit the editing mode.

Confirm Modification

Click this button to generate the SQL statement for the action. After you verify the statement, click Execute to apply the data modification. If auto-commit is turned on, the transaction is automatically committed after you click this button.

Modify and Submit

Auto-commit is turned off by default in Oracle mode, so you need to click this button to commit the current transaction. After you click this button, a dialog box appears, indicating that the current connection uses a shared session and the commit will apply to all windows. Click Yes to apply the commit. In MySQL mode, auto-commit is turned on by default, so this button is not displayed.