23
Voorbeeld
Voorbeeld: alle tabelregels selecteren
11 SQL BIND Q881 "Tab_Example.Position_Nr"
12 SQL BIND Q882 "Tab_Example.Measure_X"
13 SQL BIND Q883 "Tab_Example.Measure_Y"
14 SQL BIND Q884 "Tab_Example.Measure_Z"
. . .
20 SQL Q5 "SELECT
Position_Nr,Measure_X,Measure_Y, Measure_Z
FROM Tab_Example"
Voorbeeld: alle tabelregels met functie WHERE selecteren
20 SQL Q5 "SELECT
Position_Nr,Measure_X,Measure_Y, Measure_Z
FROM Tab_Example WHERE Position_Nr<20"
Voorbeeld: tabelregels met functie WHERE en Q-parameters selecteren
20 SQL Q5 "SELECT
Position_Nr,Measure_X,Measure_Y,
Measure_Z FROM Tab_Example WHERE
Position_Nr==:'Q11'"
Voorbeeld: tabelnaam door absolute padaanduiding definiëren
20 SQL Q5 "SELECT
Position_Nr,Measure_X,Measure_Y, Measure_Z
FROM 'V:\table\Tab_Example' WHERE
Position_Nr<20"
0 BEGIN PGM SQL_CREATE_TAB MM
1 SQL Q10 "CREATE SYNONYM NEW FOR 'TNC:
\table\NewTab.TAB'"
2 SQL Q10 "CREATE TABLE NEW AS SELECT X,Y,Z
FROM 'TNC:\prototype_for_NewTab.tab'"
3 END PGM SQL_CREATE_TAB MM
0 BEGIN PGM SQL_CREATE_TABLE_QS MM
1 DECLARE STRING QS1 = "CREATE TABLE "
2 DECLARE STRING QS2 = "'TNC:\nc_prog\demo
\Doku\NewTab.t' "
3 DECLARE STRING QS3 = "AS SELECT "
4 DECLARE STRING QS4 = "DL,R,DR,L "
5 DECLARE STRING QS5 = "FROM "
6 DECLARE STRING QS6 = "'TNC:\table\tool.t'"
7 QS7 = QS1 || QS2 || QS3 || QS4 || QS5 || QS6
8 SQL Q1800 QS7
9 END PGM SQL_CREATE_TABLE_QS MM
1364
Programmering van variabelen | Tabeltoegang met SQL-opdrachten
Synoniem maken
Tabel maken
HEIDENHAIN | TNC7 | TNCguide | 01/2022