Encrypt Result Set from SQL Statement

I have a task to run an SQL Statement, generate Result Set, encrypt it using GPG and send to user. I am using GPG4Win-3.1.15 which contains GPG 2.2.x It works fine for me BUT my goal is to get encrypted file directly from SQL query. I don't want first generate Result Set, convert it to .csv and then encrypt. Could someone advice if it's possible and how to do it?

One way to accomplish this is to use Toad's Automation Engine to create a work flow, especially if you plan on executing the flow on a scheduled basis, or want it to run unattended. Key here is to use the Run Program task so that you can call your gpg utility. You could create a simple 3-step work flow, similar to the flow template below which...

  1. Executes your SELECT and creates the result set in one step
  2. Executes a shell command to invoke your gpg utility
  3. E-mails your colleague the attached encrypted file.

The automation flow can be executed with the push of a button or scheduled to run on your workstation unattended.

Thanks so much for your advice