Perform DML operations using Visual Studio Code

You can add data, modify existing data and query data from tables usingVisual Studio Code plugin.

Insert Data

  • Locate the Table Explorer, and click the Refresh Schema to reload the schema.
  • Right click on the table where a row needs to be inserted. Choose Insert Row.
  • In the Insert Row panel, enter the details for inserting a new row. You can INSERT a new ROW in two modes:
    • Simple Input : You can use this mode to insert the new row without writing a DML statement. Here a form based row fields entry is loaded, where you can enter the value of every field in the row.
    • Advanced JSON Input : You can use this mode to insert a new row into the table by supplying a JSON Object containing the column name and its corresponding value as key-value pairs.
  • Click Insert Row.

Modify Data - UPDATE ROW/DELETE ROW:

  • Locate the Table Explorer, and click the Refresh Schema to reload the schema.
  • Click on the table where data needs to be modified.
  • In the textbox on the right under SQL>, enter the SQL statement to fetch data from your table. Click > to run the query.
  • To view individual cell data separately, click the table cell.
  • To perform DML operations like Update and Delete Row, right-click on the particular row. Pick your option from the context-menu that appears.
    • Delete Row : A confirmation window appears, click Ok to delete the row.
    • Update Row : A separate HTML panel opens below the listed rows, containing the column names and its corresponding value in a form-based entry or provide the input as ON key-pair object. You can choose either of the two methods and supply new values.

      Note:

      In any row, PRIMARY KEY and GENERATED ALWAYS AS IDENTITY columns cannot be updated.

Executing SQL Queries for a Table

  • Locate the Table Explorer, and click the Refresh Schema to reload the schema.
  • Right click on the table and choose Browse Table.
  • In the textbox on the right under SQL>, enter the SELECT statement to fetch data from your table.
  • Click > to run the query. The corresponding data is retrieved from the table.
  • Right click on any row and click Download row in to JSON file. The single row gets downloaded into a JSON file.
  • Click Download Query Result to save the complete result of the SELECT statement as a JSON file.
  • Click Fetch All Records to retrieve all data from the table.