25.01.2015 Views

Using Caché Objects - InterSystems Documentation

Using Caché Objects - InterSystems Documentation

Using Caché Objects - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Class Queries<br />

8.2.2.6 A Note on Method Compilation Order<br />

When Studio creates the querynameClose, querynameExecute, and querynameFetch<br />

methods, the querynameFetch and querynameClose methods include syntax of the form:<br />

[ PlaceAfter = querynameExecute ]<br />

The PlaceAfter method keyword ensures proper cursor declaration. The ability to control<br />

compilation order is an advanced feature that should be used with caution. <strong>InterSystems</strong> does<br />

not recommend general use of this keyword.<br />

8.2.3 The querynameClose Method<br />

The querynameClose method cleans up after data retrieval has finished. Typically, this<br />

includes removing variables from memory and closing cursors. The querynameClose method<br />

returns status information. Its sole argument is the qHandle variable of type %Binary; this is<br />

defined in querynameExecute and is passed by reference.<br />

For example, the signature of a ByNameClose method might be:<br />

ClassMethod ByNameClose(ByRef qHandle As %Binary) As %Status<br />

[ PlaceAfter = ByNameExecute ] {<br />

// query cleanup code here<br />

}<br />

62 <strong>Using</strong> <strong>Caché</strong> <strong>Objects</strong>

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

Saved successfully!

Ooh no, something went wrong!