Production message filtering: How could we find a substring inside a GlobalCharacterStream?
Hello,
We would need to find messages where a property "pEntrada" of type %GlobalCharacterStream contains "C006"
We have read:
https://docs.intersystems.com/irislatest/csp/docbook/Doc.View.cls?KEY=EM...
We have tried:
The production outputs:
How could we search in fields which are not strings?
Use method FindAt for %Library.GlobalCharacterStream
https://cedocs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=%25SYS&CLASSNAME=%25Stream.Object#FindAt
Hi Yone,
There is the class iscru.util.StreamUtils designed exactly for the purpose to solve problems like yours. The class contains streamLike() method that can be called directly or from SQL. It can also be used within business rules via iscru.util.FunctionSet.
If you want to enable searching on stream properties with Like/NotLike operators in the Message Viewer, then you would need to import iscru.util.MsgFilterAssistant class as well, then give permission to run iscru_util.FunctionSet_streamLike stored procedure to the user, and run the following command in your namespace:
Once you've done that, you can try Like operator against stream properties in the Message Viewer.
DISCLAIMER: The classes mentioned above have not been used much in real world projects yet. However there are some unit tests in the repo.
HTH, Dmitry
Hola Yone,
es posible que tengas que utilizar una consulta SQL utilizando la funcion "substring" para acceder al contenido del stream.
Algo como:
SELECT ID, SUBSTRING(resultado,1) FROM Tabladondesealmacenanesosmensajes where ID>'algunidparanobuscarentodalatabla' AND SUBSTRING(resultado,1) LIKE '%C0006%'
Referencia
View stream properties in SQL | InterSystems Developer Community | SQL