HEIDENHAIN TNC 320 User Manual page 355

Compact contouring control
Hide thumbs Also See for TNC 320:
Table of Contents

Advertisement

SQL SELECT
SQL SELECT selects table rows and transfers them to the result set.
The SQL server places the data in the result set row-by-row. The
rows are numbered in ascending order, starting from 0. This row
number, called the INDEX, is used in the SQL commands "Fetch" and
"Update".
Enter the selection criteria in the SQL SELECT...WHERE... function.
This lets you restrict the number of rows to be transferred. If you do
not use this option all rows in the table are loaded.
Enter the sorting criteria in the SQL SELECT...ORDER BY... function.
This consists of the column designation and the keyword for
ascending/descending order. If you do not use this option, the rows
are placed in random order.
Lock out the selected rows for other applications with the SQL
SELECT...FOR UPDATE function. Other applications can continue to
read these rows, but cannot change them. We strongly recommend
using this option if you are making changes to the table entries.
Empty result set:
If no rows match the selection criteria, the SQL
server returns a valid handle but no table entries.
Parameter no. for result: Q parameter for the
handle. The SQL server returns the handle for
the group of columns and rows selected with the
current "Select" command.
In the event of an error (selection could not be
executed) the SQL server returns a 1. Code 0
identifies an invalid handle.
Data bank: SQL command text: with the following
elements:
SELECT (keyword):
Name of the SQL command, names of the table
columns to be transferred. Separate column
names with a , (comma). Q parameters must be
linked to all columns entered here
FROM table name:
Synonym or path and file name of this table.
The synonym is entered directly: The path name
and table name are entered in single quotation
marks in the SQL command; names of the table
columns to be transferred – separate several
columns with a comma. Q parameters must be
bound to all columns entered here.
HEIDENHAIN | TNC 320 | Conversational Programming User's Manual | 9/2016
Accessing tables with SQL commands
Select all table rows
11SQL BIND Q881
"TAB_EXAMPLE.MEAS_NO"
12SQL BIND Q882
"TAB_EXAMPLE.MEAS_X"
13SQL BIND Q883
"TAB_EXAMPLE.MEAS_Y"
14SQL BIND Q884
"TAB_EXAMPLE.MEAS_Z"
. . .
20SQL Q5 "SELECT
MEAS_NO,MEAS_X,MEAS_Y,
MEAS_Z FROM TAB_EXAMPLE"
Selection of table rows with the
WHERE function
. . .
20SQL Q5 "SELECT
MEAS_NO,MEAS_X,MEAS_Y,
MEAS_Z FROM TAB_EXAMPLE
WHERE MEAS_NO<20"
Selection of table rows with the
WHERE function and Q parameters
. . .
20SQL Q5 "SELECT
MEAS_NO,MEAS_X,MEAS_Y,
MEAS_Z FROM TAB_EXAMPLE
WHERE MEAS_NO==:'Q11'"
Table name defined with path and file
name
. . .
20SQL Q5 "SELECT
MEAS_NO,MEAS_X,MEAS_Y,
MEAS_Z FROM 'V:\TABLE
\TAB_EXAMPLE' WHERE
MEAS_NO<20"
9
9.9
355

Advertisement

Table of Contents
loading

Table of Contents