Datasheet
14
Chapter 1
Introducing SQL
2 FROM employees
3* WHERE employee_id = 106
SQL>
8.
List the buffer to verify its contents:
SQL> LI
1 SELECT employee_id, first_name, last_name
2 FROM employees
3* WHERE employee_id = 106
SQL>
9.
Change the employee number from 106 to 110:
SQL> C/106/110
3* WHERE employee_id = 110
SQL>
10.
Save the buffer again to the same file:
SQL> SAVE myfile
SP2-0540: File “MYFILE.sql” already exists.
Use “SAVE filename[.ext] REPLACE”.
SQL>
An error is returned, because SAVE will not overwrite the file by default.
11. Save the file using the REPLACE keyword:
SQL> SAVE myfile REPLACE
Wrote file MYFILE.sql
SQL>
12.
Execute the file:
SQL> START myfile
EMPLOYEE_ID FIRST_NAME LAST_NAME
----------- -------------------- ---------
110 John Chen
SQL>
13.
Change the employee number from 110 to 106, and append this SQL to the file; then
execute it using
@:
SQL> C/110/106
3* WHERE employee_id = 106
EXERCISE 1.1 (continued)
95127c01.indd 14 2/18/09 6:37:07 AM