Changes can be made to a stored SQL statement using the CHANGE command discussed earlier in this chapter under Changing the Current SQL Statement. For example, to change the ORDER BY clause in the statement stored as DEPT, perform the following:
recall dept
The recalled statement appears as:
SELECT DEPTNO,MGRNO FROM DEPARTMENT ORDER BY MGRNO
change /by mgrno/by deptno/
The changed statement is displayed as:
SELECT DEPTNO,MGRNO FROM DEPARTMENT ORDER BY DEPTNO
store dept2
recall dept2
If you look at the query results of DEPT and DEPT2, you will notice that the FORMAT information is maintained. As long as the statement to be changed or stored contains an unchanged SELECT or FROM clause, FORMAT information is saved.