Using Select Statement Edit to limit the data retrieved by FM/Db2
You can use the Enter, execute and explain SQL statements
function (option 4.3) to enter a
SELECT statement and display the results in a File Manager/Db2 editor session. In general, if you want
to view or edit a Db2® table or view, View (option 1) and
Edit (option 2) are recommended. However, you can specify the columns to retrieve using option
4.3.
For example, the following statement retrieves all columns from
the DSN8810.EMP table:
SELECT * FROM DSN8810.EMP
However,
the following statement retrieves only the listed columns: SELECT EMPNO, FIRSTNME, MIDINIT, LASTNAME, WORKDEPT, PHONENO,
HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE FROM DSN8810.EMP
You might use this method when editing a table with many columns,
most of which are of no interest to you. Alternatively, if the Db2® object has a
widerow, omitting long VARCHAR or VARGRAPHIC columns may dramatically reduce the amount of data retrieved by FM/Db2 and loaded into the editor.
Note: When you omit columns from a Db2® object,
you may find that not all edit operations are possible. For example,
inserting a new row will fail if any of the omitted columns is defined
as NOT NULL.
Related tasks
- View and Edit options (options 1 and 2)
- Storage considerations
- Entering, executing, and explaining SQL statements
Related references