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?


1 0 2 136
Log in or sign up to continue

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