Procedure documentationEntering and Executing SQL Statements Locate this document in the navigation structure

 

You execute SQL statements in the SQL editor.

Note Note

Special editors are also available for most SQL statements for the respective database objects in the SQL editor. You can find further information in the following sections:

You can also enter SQL statements in graphical form. More information: Entering SQL Statements Graphically (Visual Query)

End of the note.

Prerequisites

  • You are logged on to the database as a database system administrator or database user.

  • You have the required privileges.

    More information: SQL Reference Manual, Privileges: Overview

  • The database is in the ONLINE operational state.

Procedure

  1. Choose SQL Editor in the context menu of the user who you want to execute the SQL statement.

    More information: SQL Editor

  2. Enter the SQL statement.

    The following rules apply:

    • You can write SQL syntax elements in either upper or lower case.

    • You can add any number of spaces and line breaks.

    • To force the system to take into account upper/lower-case letters in database object names (such as table names), enter the name between double quotation marks: "<database_object_name>"

    • To comment out a row, use // or -- at the start of the row.

    • To separate several SQL statements from one another, enter a commented-out separator line.

    Example Example

    SELECT zip, name, state

      FROM hotel.city

        WHERE name = 'Seattle'

    End of the example.

    For more information about the syntax of SQL statements, see the SQL Reference Manual and the SQL Tutorial.

  3. To execute the SQL statement, choose Execute SQL in the context menu of the SQL editor.

Result

The result of the SQL statement is displayed.

Example Example

ZIP

NAME

STATE

20005

Seattle

WA

20019

Seattle

WA

20037

Seattle

WA

End of the example.