InterSystems IRIS Data Platform 2019.2  /  Class Definition Reference

Class Definition Reference
Previous section           Next section
InterSystems: The power behind what matters   

Specifies the language used to implement this method.
To specify the language used to implement the method, use the following syntax:
Method name(formal_spec) As returnclass [ Language = language ] 
{    //implementation }
Where language is one of the following:
This keyword specifies the language used to implement this method.
The values ispl and tsql are only supported for class methods.
If you specify a value of ispl, the body of the method is limited to a single CREATE PROCEDURE statement.
If you omit this keyword, the language specified by the class-level Language keyword is used.
You cannot specify Language = ispl at the class level; you can only use this value for methods.
Class User.Person Extends %Persistent

Property Name As %String;

Property Gender As %String;

/// An ObjectScript instance method that writes the name and gender of a person
Method Print() As %Status [ Language = objectscript ]
   write !, ..Name, " is a ", ..Gender

/// A TSQL class method that inserts a row into the Person table
ClassMethod TSQLTest() As %Status [ Language = tsql ]
   INSERT INTO Person (Name, Gender) VALUES ('Manon', 'Female')

/// An ISPL class method that creates an stored procedure named IsplSp
ClassMethod ISPLTest() As %Status [ Language = ispl ]
      INSERT INTO Person (Name, Gender) VALUES ('Nikolai', 'Male')

See Also

Previous section           Next section
Send us comments on this page
View this book as PDF   |  Download all PDFs
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA
Content Date/Time: 2019-08-23 06:48:00