Collapse AllExpand All

3.1. Editing SQL Statements

As we saw in the previous section, the SELECT statement in our query source does not refer to the usr_email column. Without that column reference, we will not be able to retrieve user email address information from the database. In this section, we will edit the SELECT statement so the usr_email column is referenced. The SQL found in the Query display of a query source is straight text. It can be edited in the same was as any text can be edited. We simply click in the SELECT statement after the reference to the usr_initials column. Then, after hitting ENTER to create an extra line, we type in the usr_email reference, as shown below:

Email column added to SQL SELECT statement

We are careful to add a comma "," at the end of the usr_email reference, to indicate the column is one in a series of columns data may be retrieved from. To save the edited SQL, select the OK button. Finally, we save all report definition changes to the database.

In our next step, we will add a new field object to the Detail section of the report definition. The field object will handle the display of user email addresses retrieved from the database.