In the ZVIBERMESSAGE table, there is a reference to attachments, but that reference doesn’t include the filename, which we want to add to the final output. The information we need, the attachment filename, is actually contained in a different table. In order to use that information in the final output, we must JOIN these two tables together.

Inventorying the database for possible tables that would contain the filename resulted in the ZATTACHMENT table. Now that the table that contains the information we want is located, the task becomes JOINING these two tables by matching them on a common entry.

The ZATTACHMENT column within the ZVIBERMESSAGE table uses a number that correlates to an attachment.