Use the General page of the Tools Settings notebook to specify whether to use searched or positioned UPDATE and DELETE statements in the Control Center.
The Command Editor's Query Results tab and the Control Center's Open Table, Open View, and Open Alias pages perform updates and deletes when you directly edit the contents of table cells or delete rows in the table. By default, positioned DELETE and UPDATE statements are performed, based on the contents of the current result set.
To choose the form of DELETE and UPDATE statements in the Control Center:
Example 1: Move a clerk who has been in the company for more than two years to department 30.
SELECT JOB, DEPT FROM STAFF WHERE YEARS > 2 and JOB='Clerk'Choose one of the employees in the Query Results tab and update their department number to 30. When you click Commit, the department number is updated for the first employee matching the conditions in the Query Results.
SELECT JOB, DEPT, ID FROM STAFF WHERE YEARS >2 and JOB='Clerk' SELECT JOB, DEPT, YEARS FROM STAFF WHERE YEARS >2 AND JOB='Clerk'
Example 2: Change the job titles of all SALES employees in department 66.
SELECT JOB, DEPT FROM STAFF WHERE DEPT=66Choose one of the rows in the Query Results tab where the JOB column has a value of "Sales". Update the value in that row to a new value. When you click Commit, all employees matching the conditions in the Query Results tab have their job titles updated to the specified value. Rerun the query to see the updated values.
Example 3: Remove all clerks with less than two years in the company from the STAFF table
SELECT JOB, YEARS FROM STAFF WHERE JOB='Clerk' AND (YEARS<2 OR YEARS IS NULL)Choose one of the rows in the Query Results tab where the YEARS column has a NULL value. Click Delete Row. Then select the row where YEARS=1 and click Delete Row. When you click Commit, all four rows meeting these conditions are deleted.