Add descriptive columns

You can add a column of descriptive information to your report by putting a quoted constant in the column list of your SELECT statement. The constant within surrounding quotation marks can be up to 256 characters in length, and can be alphabetic, numeric, or a combination of the two. The following example lists the names and addresses of people in the Q.APPLICANT table with 14 years of education, and identifies each as an applicant.

This query:

SELECT NAME, ADDRESS, 'APPLICANT'
FROM Q.APPLICANT
WHERE EDLEVEL = 14
ORDER BY NAME

Produces this report:

NAME      ADDRESS            EXPRESSION 1
--------- -----------------  ------------
CASALS    PALO ALTO,CA       APPLICANT
REID      ENDICOTT,NY        APPLICANT
RICHOWSKI TUCSON,AZ          APPLICANT

The report includes three columns: one containing names, one containing addresses, and a newly created column containing the word APPLICANT for each row selected. The database manager adds a column name to the newly created column. This name varies, depending on the database manager used at your installation. You can change this column name using the form panels.

[ Previous Page | Next Page | Contents | Index ]