Find

Article
· Jan 23, 2023 2m read

Global-Streams-to-SQL #2

Some technical background information

There is not just one class in this package:  rcc.gstream.cls but also rcc.gstreamT.cls

While rcc.gstream works with direct access to the stream globals, the *T version uses
a Process Private Global (PPG) as Temporary storage.
using  SELECT * FROM RCC.gstreamT WHERE RCC.useT('^jpgS')=1 and similar.

This might be an advantage for multiple access to the same stream in sequence,
The advantage is obvious: You have a personal snapshot in memory and no risk of
a conflict in access. This might be interesting if you work just on 1 specific stream.
The disadvantage is also evident: The merge from Stream Global to PPG takes time. 
 
As a side effect I learned that the compression of stream variants GblChrCompress,
and GblBinCompress only affects the global size on disk. Once in memory, it consumes
the full size, and therefore with xDBC the full uncompressed stream gets sent over the
connection.
Differently, inside IRIX/Caché/Ensemble you only get to the stream's OID. Which makes
sense as streams typically exceed the maximum String length. To visualize this I did
something unusual as I mixed flat and compressed data into the same global.
So all even IDs are compressed streams.  

The code in the repo is written for IRIS.
But using it in Caché/Ensemble/... only requires changing the stream storage type from  
<Type>%Storage.SQL</Type> in IRIS to  <Type>%CacheSQLStorage</Type> for C/E

The base for both classes is Global mapping with SQL Storage.
And it was quite an exercise to make it dynamic.
My personal thanks go to Mike LaRocca who created a presentation about 20 years ago
that I found in my personal archives together with a related similar aged document
"Mapeo de Clases persistentes en Globales"  from a Spanish engineer
who's name was not mentioned there.

As a bonus for those who try the package, there is a medical jpeg not shown in the video.
I guess you will recognize the person immediately.




Hoping for your votes in the tools contest  !

Video

GitHub

Discussion (0)1
Log in or sign up to continue
Article
· Jan 23, 2023 2m read

Global-Streams-to-SQL

In general Global Streams are data objects embedded in Classes / Tables.
Using and viewing them with SQL is normally a part of the access to the containing tables.

SO WHAT?

During debugging or searching for strange or unexpected behavior there could be the need to 
get closer to the stored stream. No big problem with direct access to Globals with SMP or Terminal.
But with SQL you are lost.
So my tool provides dynamic access to Global Streams wherever you may need this
Special thanks to  @Oliver Wilms  for the inspiration for this tool.    

Mapping of globals to SQL is a rather traditional art from past.
Though Global Streams are somehow specialized.
But even as their Object classes have changed their representation in Global is the same.

The tricky point is that we see 4 different types of Global Streams in a common structure
Only the embedding Class /Table knows the meaning of the content.

  • %Stream.GlobalCharacter   -  raw text
  • %Stream.GblChrCompress - zipped text
  • %Stream.GlobalBinary - raw binary sequence
  • %Stream.GblBinCompress - zipped binary sequence

The Global itself has no indication, of what format it holds.
Dumping the Global just helps for raw text, the rest needs special treatment.
In combination with SQL you meet the problem of maximum field lengths.

I cover this issue by mapping all 4 types over the same stream and the user decides.
In addition, the total size and number of subnodes is also available.
For string manipulation, the first subscript level is also available as "body" VARCHAR
The Global Stream to examine is provided by a static where clause like this:

select * from rcc.gstream where rcc.use('^txtS')=1

  

WinSQL is friendly enough to let you see the full content. eg. for id=1  chr
 

and czip

with SQL the compressed data can be viewed unzipped.

Video

GitHub

1 Comment
Discussion (1)1
Log in or sign up to continue
Question
· Jan 17, 2023

CCR transition to live shows critical error

Hi Community,

I have created Tier 1 CCR and when I move it to Live it shows the below error.

I initially had changes deployed through a different CCR to the TEST environment and were not deployed to LIVE for the same class.

I tried to cancel it so that I can move these latest changes but I still get the below message.

1 Comment
Discussion (1)2
Log in or sign up to continue
Question
· Jan 10, 2023

How to execute a. pivot table and get results into %DeepSee.ResultSet passing. in filters

Hi

I have a pvot table defined. that generates a set of data.   I want. to. execute the pivot table programatically  which I believe involves using %DeepSee.ResultSet.  Does someone have an example showing how to apply filters to the results?

For. example

[DateTime of Filing].[Date].[Date Filed Year] = &[2023]

Thanks

2 Comments
Discussion (2)3
Log in or sign up to continue
Question
· Jan 10, 2023

Como saber o tamanho (quantidade de linhas) de uma global com comando direto

Existe algum comando que retorna a quantidade de linhas de uma global?

Exemplo:

^test(1)="aa"
^test(2)="aa"
^test(3)="aa"
^test(4)="aa"

Total de linhas = 4

2 Comments
Discussion (2)2
Log in or sign up to continue