HEIDENHAIN TNC 620 User Manual page 338

Conversational programming cnc control; nc software 817600-03; 817601-03; 817605-03
Hide thumbs Also See for TNC 620:
Table of Contents

Advertisement

9
Programming: Q Parameters
9.9
Accessing tables with SQL commands
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:
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
denotes an invalid handle
Data bank: SQL command text: with the following
elements:
338
If no rows match the selection criteria, the SQL
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
linked to all columns entered here
HEIDENHAIN | TNC 620 | Conversational Programming User's Manual | 10/2015
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"

Advertisement

Table of Contents
loading

Table of Contents