Written by

Manager, Application Services at InterSystems
Question Ben Spead · Sep 15, 2021

SQL Access to %Stream property on an object?

I have an ObjectScript class with a Log property of type %Stream.GlobalCharacter.  I need to search the end of each of the logs - is there a way to extract the last 10 lines of the Log stream for each object via SQL? Or is my only option to write an ObjectScript routine to walk the table and inspect each Log property one by one?

Thanks!

Comments

Ben Spead  Sep 17, 2021 to Vitaliy Serdtsev

Thank you very much @Vitaliy Serdtsev !  The Scalar Functions and Streams Doc got me what I needed (along with your example).   Here was my query:

select RecordID, ImportTimeStamp, Name, SUBSTRING(LogHistory,DATALENGTH(LogHistory)-200) As LogTail from MyClass.withStreamProperty where ORDER BY RecordID, ImportTimeStamp
 

0