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.

Testing the Existence of a Global Node<br />

KILL ^Data(100)<br />

deletes contents of node 100 within the ^Data global. If there are descendant subnodes, such<br />

as ^Data(100,1), ^Data(100,2), and ^Data(100,1,2,3), these are deleted as well.<br />

The <strong>Caché</strong> ObjectScript ZKILL command deletes a specified global or global subscript node.<br />

It does not delete descendant subnodes.<br />

You cannot use the NEW command on global variables.<br />

3.3 Testing the Existence of a Global Node<br />

You can test if a specific global (or its descendants) contains data using the <strong>Caché</strong> ObjectScript<br />

$DATA function.<br />

$DATA returns a value indicating whether or not the specified global reference exists. The<br />

possible return values are:<br />

Status<br />

Value<br />

0<br />

1<br />

10<br />

11<br />

Meaning<br />

The global variable is undefined.<br />

The global variable exists and contains data, but has no descendants. Note<br />

that the null string ("") qualifies as data.<br />

The global variable has descendants (contains a downward pointer to a<br />

subnode) but does not itself contain data. Any direct reference to such a<br />

variable will result in an error. For example, if $DATA(^y)<br />

returns 10, SET x=^y will produce an error.<br />

The global variable both contains data and has descendants (contains a<br />

downward pointer to a subnode).<br />

3.4 Retrieving the Value of a Global Node<br />

You can get the value stored within a specific global node by simply using the global reference<br />

as an expression.<br />

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

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

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

Saved successfully!

Ooh no, something went wrong!