SPOOL as SQL Table
Device #2 named SPOOL dates back to the predecessors of Caché and IRIS
It was the first "%Stream" like option to buffer output before printing.
It is also the first and still today the most simple way of output redirection.
This is also an example of a mapped Global. USE 2 write "actual date: ",$ZDT($h,3),!
redirects the output into the Global ^SPOOL
You can read the global manually or with some ancient utilities
or use this mapping to access it as class or a table with SQL.
The structure of Spool
- the global ^SPOOL is local to your namespace
- fist subscript is a UNIQUE Document_ID
- second subscript is a line number UNIQUE to the document.
- both together form the IDkey
Details: [The Spool Device]
Copy the Class User.SPOOL to your namespace and compile it.
SELECT TOP 12 ID,* FROM SPOOL WHERE Document=3