The USFile WriteBinaryFile Method
The WriteBinaryFile method writes binary data to a file.
The syntax is:
SELECT <FileName>, <value>
Where FileName is the name of the file to write to. The name is allowed to contain environment variables. If the file already exists, all data in the existing file will be lost.
SELECT '%TEMP%\ToursOverviewFileCopy.pdf', tours_pdf
WHERE id = 1