Programming: Q Parameters
9.9
Accessing tables with SQL commands
9
306
TNC 320 | User's Manual
HEIDENHAIN Conversational Programming | 3/2014
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.
Enter 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.
With 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) (see examples). Q
parameters must be bound 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
(see examples of the SQL command); names of
the table columns to be transferred—separate
several columns by a comma (see examples).
Q parameters must be bound to all columns
entered here.
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"
Summary of Contents for TNC 320
Page 4: ...Controls of the TNC 4 TNC 320 User s Manual HEIDENHAIN Conversational Programming 3 2014 ...
Page 5: ...Fundamentals ...
Page 16: ...Contents 16 TNC 320 User s Manual HEIDENHAIN Conversational Programming 3 2014 ...
Page 43: ...1 First Steps with the TNC 320 ...
Page 63: ...2 Introduction ...
Page 81: ...3 Programming Fundamentals file management ...
Page 124: ......
Page 125: ...4 Programming Programming aids ...
Page 152: ......
Page 153: ...5 Programming Tools ...
Page 180: ......
Page 181: ...6 Programming Programming contours ...
Page 232: ......
Page 233: ...7 Programming Data transfer from DXF files or plain language contours ...
Page 251: ...8 Programming Subprograms and program section repeats ...
Page 267: ...9 Programming Q Parameters ...
Page 337: ...10 Programming Miscellaneous functions ...
Page 357: ...11 Programming Special functions ...
Page 379: ...12 Programming Multiple Axis Machining ...
Page 406: ......
Page 407: ...13 Manual operation and setup ...
Page 462: ......
Page 463: ...14 Positioning with Manual Data Input ...
Page 468: ......
Page 469: ...15 Test run and program run ...
Page 497: ...16 MOD functions ...
Page 525: ...17 Tables and overviews ...