User bio
404 bio not found
Maine, USA
Member since Feb 18, 2016
Posts:
Replies:
I assumed that she wanted to purge the messages returned by this query:
select * from Ens.MessageHeader nolock
where timecreated < '2025-02-11 00:00:00.000'
order by timecreated
If they'd already been purged, there would be no headers returned.
If you're certain that you want to have those messages purged, you can run an UPDATE query against Ens.MessageHeader using the same criteria, but setting the Status field to 4 (Discarded).
Status |
ID |
Created |
1 |
Queued |
2 |
Delivered |
3 |
Discarded |
4 |
Suspended |
5 |
Deferred |
6 |
Aborted |
7 |
Error |
8 |
Completed |
9 |
Certifications & Credly badges:



Global Masters badges:







Followers:
Following:
Something like this should do the trick:
ClassMethod GetConnectionStatus(pItemName As %String, ByRef pStatus As %String, ByRef pState As %String) As %Status [ Language = objectscript ] { Set tStatement = ##class(%SQL.Statement).%New() Set tSC = tStatement.%PrepareClassQuery("Ens.Util.Statistics","EnumerateJobStatus") Return:$$$ISERR(tSC) tSC Set tRS = tStatement.%Execute(pItemName) If tRS.%SQLCODE = 0 { Do tRS.%Next() Set pStatus = tRS.%Get("Status") Set pState = tRS.%Get("AdapterState") Return $$$OK } Return $$$ERROR(5001,"Status not Found") }
Call it with the status and state variables passed by reference:
Set sc=##class(My.Class).GetConnectionStatus("T_SPM_SIU",.status,.state)