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. You must have INSERT permission on the table to add new rows.
Right-click the result set and choose Add Row.
A new blank row appears with a blinking cursor in the first value in the row.
Enter the new value and then press Tab to move to the next column.
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.
Repeat this step until all the column values are added.
Press Enter to update the database.
When adding a value in a column that has a default value, the cell editor contains a list with a (DEFAULT) item. Select (DEFAULT) if you want 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.
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.
An alternative to inserting new rows from the result set in Interactive SQL is to add rows using the INPUT statement with the PROMPT clause. When the PROMPT clause is specified, Interactive SQL prompts you for the value for each column in the table. For example, to add a new row to the Products table and be prompted for the values for each column, you would execute the following statement in Interactive SQL:
INPUT INTO Products PROMPT;
|Discuss this page in DocCommentXchange.
Send feedback about this page using email.
|Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1|