User bio

my video https://youtu.be/zx6WoApljBI
my business story https://community.intersystems.com/post/45-years-intersystems-1978-2023

  • main languages: German, English, Italian, French, Spanish, Latin, ..
  • private: married since 1969, 3 successful children

  

Member since Jul 21, 2017
Replies:

assuming  Document.StreamGC is of type %Stream.Object you may
use method FindAt which combines Read() and Contains()
see: method FindAt() 

method FindAt(position As %Integer, target As %RawString,
   ByRef tmpstr As %RawString = "", caseinsensitive As %Boolean = 0) as %Integer

Find the first occurrence of target in the stream, starting the search at position.
The method returns the position of this match, counting from the beginning of 
the stream, and leaves the stream positioned at an indeterminate location. 
If it does not find the target string, it returns -1.

If position=-1 then it starts searching from the location found in the 
previous search and returns the offset from the last search. 
This is useful for searching through the entire file. 
If you are doing this, you should pass in tmpstr by reference in every call. 
This is used to store the last buffer read, so the next call will start 
where the last one left off. 
If caseinsensitive=1 then the search will be case insensitive, 
rather than the default case-sensitive search.

A very dirty hack:  possible not really a recommendation

IF Source table is not mapped to ONS

  1. copy class definition including <Storage> from ENS to ONS
  2. in <STORAGE> you see
  3. <DataLocation>^Sample.EmployeeD</DataLocation>
    <IdLocation>^Sample.EmployeeD</IdLocation>
    <IndexLocation>^Sample.EmployeeI</IndexLocation>
    <StreamLocation>^Sample.EmployeeS</StreamLocation> 
  4. Now replace all  ^  by ^|"ENS"|  looks similar 
    For my example, it's ^|"SAMPLES"|
  5. <DataLocation>^|"SAMPLES"|Sample.EmployeeD</DataLocation>
    <IdLocation>^"|SAMPLES"|Sample.EmployeeD</IdLocation>
    <IndexLocation>^|"SAMPLES"|Sample.EmployeeI</IndexLocation>
    <StreamLocation>^|"SAMPLES"|Sample.EmployeeS</StreamLocation> 
  6. Extended Global references allow access to the other namespace. Nothing new, but risky
Open Exchange applications:
Certifications & Credly badges:
Robert has no Certifications & Credly badges yet.
Followers:
Following: