You can create and run an SQL query using the DB2 Web Query email interface. Before you can use the email interface, your system administrator must authorize you as an email user for the database you wish to access.
To create a query using the email interface:
1. Email DB2 Web Query at the database you wish to access.
DB2 Web Query replies with the subject "DB2 Web Query SMTP Server".
2. Reply to the email. Between the { } following "cmd" at the end of the email, type "help", then send the reply.
DB2 Web Query replies with an email containing a list of possible commands.
3. Reply to the email. Between the { } following "cmd" at the end of the email, type "run sql".
4. If desired, type a format preference, such as "format:html", and a row limit, such as "rowlimit:50". You can also enter an alternate email address to send the query results to, such as "email:you@youraddress.com".
5. Type the SQL statement you wish to run.
For example, if you wish to view all rows from the table GROUP.TABLE, email the results to you@youraddress.com, and view the results in html format, the last line in your reply might look like this:
cmd {run sql format:html email:you@youraddress.com SELECT * FROM GROUP.TABLE}
6. Send the reply.
DB2 Web Query runs the query and returns the results according to your specifications.