Writing and editing SQL statements in the Java editor

In the Java™ editor, there are a number of features that can help you write and edit SQL statements.

Procedure

To use the SQL assistance features:

  1. With your cursor in the SQL statement, type CTRL+SPACE to see the following options. CTRL+SPACE is the default key combination for this action. If you want to change this combination, select Window > Preferences. In the Preferences window, select General > Keys. Double-click the row in which the value in the Command column is "Content Assist".
    1. If you want help choosing an SQL keyword, look for entries with this icon: Icon for SQL keywords

      You can select from a list of SQL keywords that are appropriate for the statement, given the current position of the text cursor.

    2. If you want help choosing an SQL template, look for entries with this icon: Icon for SQL templates

      You can select from a list of SQL templates that are appropriate for the given type of SQL statement.

    3. If you want help choosing a database object, look for an entry with one of the following icons:
      • Column: Icon for columns

        You can select from a list of columns that are in a table. The list can appear for column annotations, as well as for SQL statements.

      • Primary key column:Icon for primary-key columns

        You can select from a list of primary-key columns that are in a table. The list can appear for column annotations, as well as for SQL statements.

      • Schema: Icon for schemas

        You can select from a list of schemas in the database that is associated with your Java project. The list can appear for table annotations, as well as for SQL statements.

      • Table: Icon for tables

        You can select from a list of tables that are in the database that is associated with your Java project. The list can appear for table annotations, as well as for SQL statements.

    4. If you want help choosing a host variable, look for entries with this icon: Icon for host variable

      You can select from a list of properties that are defined in a bean.

  2. Double-click the entry, or select the entry and type Enter.

Results

The entry appears in the SQL statement.

Feedback