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
Did you look in the direction of %Stream.GlobalCharacterSearchable?
See also Scalar Functions and Streams
SELECT Notes Stream,DATALENGTH(Notes) lenStream,SUBSTRING(Notes,DATALENGTH(Notes)-9) AS StreamLast10Chars FROM Sample.Employee WHERE Notes IS NOT NULL
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