Exploring Database Schema with Oracle Database Explorer

To view Database Explorer, click the database icon in the Activity Bar on the far left side of Visual Studio Code.

  • Connect: Click the plus (+) sign to create a new connection, following the steps in Connecting to Oracle Database or Connecting to Oracle Autonomous Database (ADB). Once connection nodes display, you can click on the node to view the database schema.

  • Delete Connection: Right click on any connection node and select Delete

  • Update Connection info: Right click on any connection node and select Update

  • Set a connection to be the default used when opening a SQL or PL/SQL file: Right click on any connection and select Set as Default Connection. The icon for the default connection will contain an asterix(*) in the upper left hand corner.

  • Clone Connection: Right click on any connection node and select Clone

  • Unset a connection as a default connection: Right click on the default connection and select Unset as Default Connection.

  • Disconnect: Right click on any connection node and select Disconnect

  • View Other Users/Other Schemas: Click to expand the Other Users node. Select the schema you wish to view. Alternately, click on the connection node and select Update. In the connection dialog, check the Show more options checkbox then select a different schema in the Current Schema dropdown. Press the Update Connection button.

  • View and Save Table/View Data: On a Table and View node's menu, select Show Data. For more information see Viewing and Saving Result Sets below.

  • Generate SELECT, INSERT, or DELETE statements for a table: On a Table node, right click and select Generate Select SQL, Generate Insert SQL, or Generate Delete SQL from the menu. The SQL will be added to an open SQL script file that is selected, or a new SQL file will be opened containing the SQL.

  • View metadata for a schema object (describe): On any schema object node, right click and select the Describe menu item.

  • Edit PL/SQL: On stored procedures, functions, packages, or trigger nodes select Open/Open Package Body/Open Specification to open PL/SQL into a file for editing. See Editing PL/SQL in your Database for more details.

  • Save PL/SQL to database: If the PL/SQL was opened with the Open menu item in Database Explorer, you can save changes to the database by right clicking in the PL/SQL code and selecting Save. If there are errors when saving, they will be listed in the Problems panel, and you can click on an error to go to the line that contains the error. (Note: these menu names were previously named Edit PL/SQL and Save to Database in earlier releases.)

  • Save PL/SQL to file: In Oracle Database Explorer right click a package, procedure, function, or trigger and from the menu and select Download. Alternatively, after opening the package, procedure, function, or trigger from Database Explorer select the tab with the PL/SQL code in it. In Visual Studio Code menu select File->Save As and then click Show Local.

  • Execute PL/SQL:From menu, select Run to execute a stored procedure or function

  • Debug PL/SQL: Right click on a connection name and select PL/SQL Debugger and Compiler Settings to set the ip address and port number range that will be used. A script to grant privileges and configure the database is also provided in the dialog. To compile with debug information, right click on a procedure/function/package and select Compile Debug from the menu. To begin debugging, from the same menu select Step Into or Run Debug (if the PL/SQL is already open and breakpoints set). To listen for and debug PL/SQL procedures and functions called by applications or SQL scripts, right click on a connection name and select Start External Application Debugger. For more details on PL/SQL debugging, see the Debugging PL/SQL from Oracle Database Explorer and Debugging PL/SQL Called By an Application or SQL Scripts sections.

  • Refresh: Right click on any node and select Refresh to refresh that node and all child nodes

  • Filter: Right click on the connection node and select Filters to open the Filters dialog. See Applying Filters to Oracle Database Explorer and IntelliSense Suggestions.