Embedded SQL, as in the following example:
&sql(SELECT COUNT(*) INTO :myvar FROM Sample.Employee)
IF SQLCODE<0 {WRITE "SQLCODE error ",SQLCODE," ",%msg QUIT}
ELSEIF SQLCODE=100 {WRITE "Query returns no results" QUIT}
WRITE myvar
The first line is embedded SQL, which executes an InterSystems SQL query and writes a value into a host variable called myvar.
The next line is ordinary ObjectScript; it simply writes the value of the variable myvar.
You can use embedded SQL in ObjectScript methods and routines.