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

Once you execute a query in Interactive SQL, you can sort and edit the result set to modify the database.

To sort a result set, click a column header in the Results tab to sort the results by that column. If the Results tab does not contain the entire result set, you are prompted to fetch the remaining results. Otherwise, only the currently retrieved results are sorted.

You can also select rows from the result set and copy them for use in other applications. The field delimiter, quoting character, and escape character for the results are controlled by the isql_field_separator, isql_quote, and isql_escape_character options, respectively. These options can be viewed and changed in Options window in Interactive SQL or by executing the SET OPTION statement.

Interactive SQL supports editing, inserting, and deleting rows. Editing the result set has the same effect as executing UPDATE, INSERT, and DELETE statements. After editing a result set, the equivalent INSERT, UPDATE, and DELETE statements are added to the Interactive SQL command history.

To edit a row or value in the result set, you must have the proper privileges on the table or column you want to modify values from. For example, to delete a row, then you must have DELETE privilege for the table the row belongs to.

You cannot edit a result set if you:

  • Select columns from a table with a primary key, but do not select all the primary key columns.

  • Attempt to edit the result set of a JOIN (for example, if there is data from more than one table in the result set).

  • Attempt to edit a table that has its editing disabled.

Editing the result set may fail if you:

  • Attempt to edit a row or column you do not have privileges on.

  • Enter an invalid value (for example, a string in a numeric column or a NULL in a column that does not allow NULLs).

When editing fails, an Interactive SQL error message appears explaining the error, and the database table values remain unchanged.

 See also

Editing a row in an Interactive SQL result set
Disabling table editing in Interactive SQL
Inserting a new row into an Interactive SQL result set
Deleting a row from an Interactive SQL result set
Copying rows, columns, and cells from an Interactive SQL result set