Creating a data editor request for a Db2 table


  1. On the menu bar, click View > Command Palette or press Ctrl+Shift+P.
  2. In the command palette, start typing DevX File-AID: Create Data Editor Request for a Db2 Table and select it from the list. Alternatively, you can right-click the data set and select Browse or Edit.
    The Data Editor Request (Db2) page is displayed.

    image-2024-3-1_14-50-55.png
  1. If you have opened the Data Editor Request (Db2) dialog box from the context menu, the HCI connection and Db2 table fields are already populated, so skip to step 5.
  2. If you opened the dialog box from the command palette, follow these steps:
    1. Select the HCI connection.
    2. Click Find and select the Db2 table name. Once the Db2 table is validated, the Selection Criteria tab is enabled. 

      Selection Criteria tab

      In the Selection Criteria tab, you can apply any of the following selection criteria and when the request is run, the selection criteria is applied. 

      Purpose

      Action

      Filter column names in the Db2 table

      1. Select the Query builder tab.
      2. From the Filter columns display menu, select the columns you want to display in the Db2 table.
      3. To delete any selected column name, hover over it and click the image-2024-5-15_19-11-44.pngicon beside it.

      Sort column names in the Db2 table

      1. Select the Query builder tab.
      2. From the Sort by the following columns menu, rearrange them by dragging them.

      View the generated SQL

      1. Select the Query builder tab.
      2. Click View SQL. By default, Select * from <table_nameis displayed.
      3. To copy the SQL, click Copy SQL.

      Run custom SQL for the Db2 request

      1. Select the Custom SQL tab.
      2. You can modify the default query to run it. You cannot run a non-select query here. You receive a validation error if you change the database or table name.

      Select a data set member

      1. Select the Data set tab.
      2. Click Find
      3. Select a data set member with information on the selection criteria. 

      The selection criteria are applied when the request is run.

  3. In the Display section, enter the maximum number of rows you want to view in the table and the maximum number of rows that you want to view per page. 

    SuccessBest practice
    We recommend entering a value between 1 and 2000. A high value causes record loading to take longer.
     

    Warning

    Important

    Your Db2 administrator can set a record limit in the mainframe. If the administrator has not set any limit for the records, you can enter any value, and records are displayed based on the set value. When the administrator sets a maximum limit, you see the maximum number of records set by the administrator.

  4. (Optional) Select the Retrieve rows with uncommitted reads check box to allow statements to read rows modified by other transactions that have not yet been committed.
  5. In the Run mode section:
    1. Select Browse or Edit.
    2. If you selected Edit:
      1. Specify whether to enable auditing. Auditing is enabled by default.
      2. Select Audit edit section for shared use
  6. Click Run.

    image-2024-6-6_16-10-9.png

  7. Perform the following actions in the table in the text and hexadecimal mode.

    Purpose

    Action

    Freeze and unfreeze column

    Right-click on the column heading and select Freeze to freeze the column and Unfreeze to unfreeze the column.

    Edit fields in a row

    1. Double-click a row, or right-click it and click Edit.
    2. Edit the fields.
    3. To save your edit to the cache, click image-2023-12-6_11-31-19.pngor press Enter. If you have inserted an incorrect value, an error message is displayed, and the original field value is restored.
      The image-2023-12-6_11-35-32.pngicon is displayed beside the row. 
    4. To cancel an edit, click image-2023-12-6_11-33-35.png.
    5. To save the edited record, press Ctrl+S. To discard your edits, right-click and select Undo Pending Edit.

    When multiple users try to update the same record of the same table, the following error message is displayed in the notification.

    image-2024-5-24_21-27-41.png

    Insert a row

    1. Right-click and select Insert.
    2. Enter the required details in the inserted row and press Enter.
      You see the green icon (
      image-2023-12-6_15-54-57.png) beside the row and on mouse hover it displays that the inserted record will be saved once you save the page.
    1. To remove the inserted row, right-click and select Undo Pending Insert or press Ctrl +s to insert the row. 

    Delete a row

    1. Right-click the row and select Delete.
      The image-2023-12-6_12-11-54.pngicon is displayed beside the row.
    2. To keep the row, right-click it and select Undo Pending Delete.
    3. To save your deletion, press Ctrl+S.

    Duplicate a row

    1. Right-click on the row and select Duplicate.  A new row is inserted and all values of the selected row are copied to the new row,
    2. Press Enter to save the row.
      You see the green icon (image-2023-12-6_15-54-57.png) beside the row.
    3. Right-click and select Undo Pending Insert or press Ctrl +s to insert the row. 
    4. To remove the inserted row, Right-click and select Undo Pending Insert or press Ctrl +s to insert the row and save the changes.

    Reverse an edit, insertion, or deletion

    1. Click Undo Page (image-2024-2-7_18-9-36.png).
    2. In the notification, click Undo Page.

You can expand the row to view and edit the data added in the rows in hexadecimal and text mode. 

image-2024-6-21_12-11-29.png


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC AMI DevX Workbench for VS Code 25.1