Forked from BirgittaHauser/Scan_All_Spoolfiles_in_an_Outqueue.sql
Created
September 4, 2022 14:04
-
-
Save dancarlosgabriel/615a6da81552008615da66ebf388c7af to your computer and use it in GitHub Desktop.
Scan through all spoolfiles in a specific outqueue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Scan through all spoolfiles in a specific outqueue (e.g. QEZJOBLOG) for a specific string | |
Select a.Job_Name, Spooled_File_Name, File_Number, Spooled_Data | |
-- , a.* | |
from OutPut_Queue_Entries a Cross Join | |
Lateral(Select * | |
From Table(SysTools.Spooled_File_Data( | |
Job_Name => a.Job_Name, | |
Spooled_File_Name => a.Spooled_File_Name, | |
Spooled_File_Number => File_Number))) b | |
Where Output_Queue_Name = 'QEZJOBLOG' | |
and Spooled_Data like '%WhateverYouWant%'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment