January 2012 8.12 Tables 1625
SQL-HANDLE The SQL handle identifies the result set of a previous SQL query. Only values 
assigned by the SQL server are valid handles.
The value 0 identifies an invalid handle.
Definition
 sql-handle  := HANDLE q-number
SQL index The SQL index identifies the row from the result set. The indices start at 0 and 
are listed in increasing order.
If no index is specified, the first row from the result set is automatically 
transferred.
Definition
 sql-index  := INDEX ( index | q-number )
SQL column The name of the table and of the column to be bound is to be enclosed in 
double quotation marks.
Definition
 table-name := name
 column-name := name
 sql-column := '"' table-name '.' column-name '"'
SQL statement Enclose the statement to be executed in double quotation marks. A reference 
to a Q parameter can be used within 
a statement. Enclose the Q parameter in single 
quotes after a colon. The interpreter replaces this sequence with the value of 
the Q parameter.
Definition
 sql-replacement:= ':' ''' q-parameter '''
 sql-statement:= literal
Example:
SQL Q5 " SELECT L, R FROM TOOL WHERE N = :'Q2' " 
SQL The NC block SQL defines an SQL statement to be executed. The SQL 
HANDLE, which will enable you to access the data at a later date, is stored in 
the specified parameter. It is valid until the transaction has been committed or 
canceled for all rows of the result set.
Definition
 sql-execute := SQL q-parameter sql-statement
Example:
SQL Q5 " SELECT L, R FROM TOOL WHERE N = :'Q2' "