25.01.2015 Views

Using Caché Multi-Dimensional Storage - InterSystems ...

Using Caché Multi-Dimensional Storage - InterSystems ...

Using Caché Multi-Dimensional Storage - InterSystems ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3<br />

<strong>Using</strong> <strong>Multi</strong>dimensional <strong>Storage</strong><br />

(Globals)<br />

This chapter describes the various operations you can perform using multidimensional storage<br />

(global variables).<br />

3.1 Storing Data in Globals<br />

Storing data in global nodes is simple: you treat a global as you would any other variable.<br />

The difference is that operations on globals are automatically written to the database.<br />

3.1.1 Creating Globals<br />

There is no setup work required to create a new global; simply setting data into a global<br />

implicitly creates a new global structure. You can create a global (or a global subscript) and<br />

place data in it with a single operation, or you can create a global (or subscript) and leave it<br />

empty by setting it to the null string. In <strong>Caché</strong> ObjectScript, these operations are done using<br />

the SET command.<br />

The following examples define a global named Color (if one does not already exist) and<br />

associate the value “Red” with it. If a global already exists with the name Color, then these<br />

examples modify it to contain the new information.<br />

In <strong>Caché</strong> Basic:<br />

^Color = "Red"<br />

<strong>Using</strong> <strong>Caché</strong> <strong>Multi</strong>-<strong>Dimensional</strong> <strong>Storage</strong> 15

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!