DatabaseSQLSnippets

SQL Code Snippets

Issue 134113

Description

Make it easy to generate SQL statements using shortcuts within the SQL editor. Once the SQL is generated, the SQL source can be saved in an SQL file, for later reuse (by reopening the file).

The SQL editor currently can save and open SQL files. In 6.5, support SQL generation using shortcut keys, e.g. Ctrl-Alt-I, to generate an insert statement

Another aspect of this feature is to make it easy to store and load snippets from within the SQL editor, e.g. a keyboard shortcut brings up a drop-down list and you can type to filter out possible names and see the first <n> lines of the snippet, then pick it and it pastes into your editor.


Use Cases

With the SQL Editor opened and connection set in the dropdown...


  • Type Ctrl-Alt-s
  • Result: the following statement is entered: SELECT () from ()
  • Type Ctrl-Alt-i
  • Result: the following statement is entered: INSERT INTO () VALUES
  • Type Ctrl-Alt-u
  • Result: the following statement is entered: UPDATE SET WHERE
  • Type Ctrl-Alt-d
  • Result: the following statement is entered: DELETE () FROM ()
  • Click the mouse inside the () for columns then type Ctrl-Alt-c
  • Result: a dropdown with available columns is available for the user to choose
  • Click the mouse inside the () for tables
  • Result: a dropdown with available tables is available for the user to choose
  • Select a table from the dropdown
  • Result: if statement has columns then fill in the columns for the table with default values
  • Click the mouse inside the () for tables then type Ctrl-Alt-v
  • Result: a dropdown with default values corresponding to columns selected is available for the user to choose
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo