Using interactive SQL

Interactive SQL allows a programmer or a database administrator to quickly and easily define, update, delete, or look at data for testing, problem analysis, and database maintenance.

A programmer, using interactive SQL, can insert rows into a table and test the SQL statements before running them in an application program. A database administrator can use interactive SQL to grant or revoke privileges, create or drop schemas, tables, or views, or select information from system catalog tables.

After an interactive SQL statement is run, a completion message or an error message is displayed. In addition, status messages are normally displayed during long-running statements.

You can see help about a message by positioning the cursor on the message and pressing F1 (Help).

The basic functions supplied by interactive SQL are:

  • The statement entry function allows you to:
    • Type in an interactive SQL statement and run it.
    • Retrieve and edit statements.
    • Prompt for SQL statements.
    • Page through previous statements and messages.
    • Call session services.
    • Start the list selection function.
    • Exit interactive SQL.
  • The prompt function allows you to type either a complete SQL statement or a partial SQL statement, press F4 (Prompt), and then be prompted for the syntax of the statement. It also allows you to press F4 to get a menu of supported SQL statements. From this menu, you can select a statement and be prompted for the syntax of the statement.
  • The list selection function allows you to select from lists of your authorized relational databases, schemas, tables, views, columns, constraints, or SQL packages.

    The selections you make from the lists can be inserted into the SQL statement at the cursor position.

  • The session services function allows you to:
    • Change session attributes.
    • Print the current session.
    • Remove all entries from the current session.
    • Save the session in a source file.