Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - Database Administration » Database administration » SQL Anywhere graphical administration tools » Interactive SQL » Result sets in Interactive SQL

 

Inserting a new row into an Interactive SQL result set

Interactive SQL allows you to add new rows to a table. You tab between columns in the result set to add values to the row.

Prérequis

You must have INSERT privilege on the table to add new rows.

You must have executed a query to have a result set.

Contexte et remarques

You cannot enter invalid data types into a column. For example, you cannot enter a string into a column that accepts the INT data type.

 Task
  1. In Interactive SQL, right-click the result set and click Add Row.

    A new blank row appears with a blinking cursor in the first value in the row.

  2. Enter the new value and then press Tab to move to the next column.

    Option Action
    Insert values into columns with default values When adding a value in a column that has a default value, the cell editor contains a list with a (DEFAULT) item. Click (DEFAULT) to insert the default value. Similarly, if a column accepts NULL values, (NULL) appears in the list. If a column cannot be NULL and does not have a default value, you must enter a value.
    Insert values into computed columns If the result set contains a computed column and you do not specify a value for the computed column, the value is calculated when the database is updated. However, if you specify a value for the computed column, the database is updated with the specified value, and a value is not calculated for the computed column.

    Repeat this step until all the column values are added.

  3. Press Enter to update the database.

  4. Execute a COMMIT statement to make your changes to the database permanent.

Résultat

You have inserted a new row into the database.

 See also