13.07.2015 Views

Using Caché Studio - InterSystems Documentation

Using Caché Studio - InterSystems Documentation

Using Caché Studio - InterSystems Documentation

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.

8Adding Queries to a Class<strong>Caché</strong> class definitions may contain query definitions. Each query defines an instance of query interface:a set of methods that can be called from a <strong>Caché</strong> %ResultSet object allowing you to iterate over a setof data.You can use queries in the following ways:• Via the %ResultSet class in server-based methods.• Via the Java ResultSet class that is included with the <strong>Caché</strong> Java binding.• Via the ActiveX ResultSet class that is included with the <strong>Caché</strong> ActiveX binding.• As ODBC or JDBC stored procedures (if you specify that the query should be projected as anSQL stored procedure).There are two kinds of queries:• Those based on SQL statements (using the %SQLQuery class) and• Those based on user-written code (using the %Query class).The %SQLQuery class automatically provides an implementation of the query interface. The %Queryclass does not; the query definition merely provides a query interface; you must write methods toimplement the actual query functionality.You can add a new query to a class definition in two ways:• Edit the class definition using the Class Editor.• <strong>Using</strong> the New Query wizardTo add a query using the Class Editor, position the cursor on a blank line in the Class Editor and entera query declaration:<strong>Using</strong> <strong>Caché</strong> <strong>Studio</strong> 53

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

Saved successfully!

Ooh no, something went wrong!