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.

Adding Queries to a Class8.1.6 Row Specification PageFor a user-written query, you must specify the names and types of the columns that are to be returnedby the query.The wizard does not prompt for this information for SQL-based queries as the class compiler candetermine it by examining the SQL query.8.1.7 Results of Running the New Query WizardAfter you run the New Query wizard, the Class Editor window is updated to include the new querydefinition. For example:/// This is a Person classclass MyApp.Person extends %Persistent [ClassType = persistent]{Query ByName(ByVal name As %String) As %SQLQuery(CONTAINID = 1){SELECT ID,Name FROM PersonWHERE (Name %STARTSWITH :name)ORDER BY Name}}If you want to make further modifications to this query you can do this using either the Class Editoror the Class Inspector.If you specified a user-written query, the Class Editor contains both the new query definition as wellas skeletons of the query methods you are expected to implement:Class MyApp.Person Extends %Persistent [ClassType = persistent]{// ...ClassMethod MyQueryClose(ByRef qHandle As %Binary) As %Status [ PlaceAfter = MyQueryExecute ]{Quit $$$OK}ClassMethod MyQueryExecute(ByRef qHandle As %Binary,ByVal aaa As %Library.String) As %Status{Quit $$$OK}ClassMethod MyQueryFetch(ByRef qHandle As %Binary,ByRef Row As %List,ByRef AtEnd As %Integer = 0) As %Status [ PlaceAfter = MyQueryExecute ]{56 <strong>Using</strong> <strong>Caché</strong> <strong>Studio</strong>

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

Saved successfully!

Ooh no, something went wrong!