| Command group | Flag affected | Reversible | Execute on client | Platform(s) |
| SQL Object Commands | NO | NO | NO | All |
This command appends script data to the SQL buffer for the current method stack.
The Begin statement command clears the buffer ready for a new statement. The sql-script parameter is a text field which can contain square bracket and indirect square bracket notation (which you use to send data to the server as a "bind" variable).
Multiple Sta: sql-script lines are added to the SQL buffer, and separated with the delimiter(s) specified by the Begin statement command. This allows you to split a SQL statement over more than one line, but note that literal values must not be split between lines. The SQL buffer can contain more than one SQL statement provided you use the appropriate statement delimiter.
Text loaded into the buffer must be valid SQL, and must be understood by the server. You can use square brackets to load the buffer with text obtained from Omnis functions, variables and calculations. Indirect bind variable notation of the form @[Field] is not evaluated in Omnis but is handled by the DAM, and lets you pass field values to the server without the need for them to be included in the text of a SQL statement.
# Open a multi-threaded omnis sql connection to# the datafile mydatafile and create a statement to# delete rows from the table Customers
CalculatelHostnameascon(sys(115),'mydatafile.df1')
DoiSessObj.$logon(lHostname,'','','MYSESSION')
DoiSessObj.$newstatement('MyStatement')ReturnslStatObj
Begin statementSta:Delete From CustomersSta:Where Cust_ID > 100Sta:And Cust_ID<110
End statement
DolStatObj.$execdirect()
DolStatObj.$fetch(lMyList,)