9
You can also define synonyms for tables that have not
yet been generated.
The sequence of the columns in the created file
corresponds to the sequence within the AS SELECT
instruction.
Example: Generate a table with CREATE TABLE and QS
For the instructions within the SQL command, you can
likewise use single or combined QS parameters.
If you check the content of a QS parameter in the
additional status indicator (QPARA tab), then you will see
only the first 30 characters and therefore not the entire
content.
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
338
Programming Q parameters | Accessing tables with SQL statements
HEIDENHAIN | TNC 620 | Klartext Programming User's Manual | 01/2022