Executing SQL and PL/SQL

  1. Type some SQL or PL/SQL you wish to execute into the .SQL or .PLSQL file

  2. While typing, autocomplete suggestions will appear as you type, for example column names. You can click the i icon in the suggestions to get more details such as the schema objects the suggestion is associated with. Use the arrow keys to navigate through the suggestions, and the enter key to select a suggestion. If you wish to use lower case characters with autocomplete suggestions, go to the settings and change Intellisense › Suggestions: Keyword Casing and Intellisense › Suggestions: Object Name Casing to lowercase.

  3. Type a schema name followed by a period, for example HR. to use intellisense to view and select database objects.

  4. While typing, some code snippet suggestions may appear. You can view more snippets by typing oracle on a new line.

  5. Position the cursor on a line that contains the SQL or PL/SQL that you wish to execute. Alternately, you can select (highlight) one or more SQL or PL/SQL statements. Right click and select Execute SQL from the menu. Select Execute All if you wish to execute all SQL and PL/SQL in the current file.

  6. After executing SQL, a new document (Results Window) will open or the results will be appended to an open Results window. The maximum number of rows that can be returned is controlled by the Max Rows extension setting. As you scroll through the rows, more will be fetched - up to this maximum.

  7. To clear the results window, click the Clear Results Window button located in the area near the document tabs. To change the default to always clear the results window after every execution, change the Clear Results Window extension setting.

    • Errors that occur when running the script will be listed in the Problems Panel. Click on an error to go to the line that contains the error.

    • By default, SQL statements will automatically commit (auto commit is on). To change this, see Disable/Enable Auto Commit in the section below.

    • In addition to SQL and PL/SQL, you can enter SQL*Plus commands as well. For more information see the Executing SQL*Plus Commands section and visit Using SQL*Plus Commands with Oracle Developer Tools for VS Code