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 Write() [ Language = objectscript ]
{
write !, ..Name, " is a ", ..Gender, !
}
/// An Embedded Python instance method that prints the name and gender of a person
Method Print() [ Language = python ]
{
print('\n' + self.Name + ' is a ' + self.Gender)
}
/// A TSQL class method that inserts a row into the Person table
ClassMethod TSQLTest() [ Language = tsql ]
{
INSERT INTO Person (Name, Gender) VALUES ('Manon', 'Female')
}
/// An ISPL class method that creates a stored procedure named IsplSp
ClassMethod ISPLTest() [ Language = ispl ]
{
CREATE PROCEDURE IsplSp()
INSERT INTO Person (Name, Gender) VALUES ('Nikolai', 'Male')
END PROCEDURE
}
}