1. Open your workbook in Discoverer.

2. Choose View then select SQL Inspector from the menu. 

Image of menu bar

Image of SQL Inspector screen

3. Click on the Export button at the bottom right of the SQL Inspector.

Image of export button

4. Designate a folder in which to save all of your SQL files, enter a descriptive file name (the name of the Discoverer report is good), and click the Save button.

5. You can now close out this workbook and open another one to export its SQL.