Skip to main content

Embedded SQL

You can embed SQL within ObjectScript on InterSystems IRIS® data platform.

Embedded SQL

Embedded SQL allows you to include SQL code within an ObjectScript program. The syntax is &sql( ). For example:

  &sql( SELECT Name INTO :n FROM Sample.Person )
  WRITE "name is: ",n

Embedded SQL is not compiled when the routine that contains it is compiled. Instead, compilation of Embedded SQL occurs upon the first execution of the SQL code (runtime).

For further details, refer to the Using Embedded SQL chapter in Using InterSystems SQL.

Feedback