Binding a variable to a table column with SQL BIND

Application

SQL BIND links a variable to a table column. The SQL commands FETCH, UPDATE, and INSERT evaluate this binding (assignment) during data transfer between the result set and the NC program.

Requirements

  • Code number 555343
  • Table exists
  • Appropriate table name
  • The names of tables and table columns must start with a letter and must not contain an arithmetic operator (e.g., +). Due to SQL commands, these characters can cause problems when data are input or read.

Description of function

Program any number of bindings with SQL BIND..., before using the FETCH, UPDATE, or INSERT commands.

An SQL BIND command without a table name or column name cancels the binding. At the latest, the binding is terminated at the end of the NC program or subprogram.

Input

NC programs contained in this User's Manual are suggestions for solutions. The NC programs or individual NC blocks must be adapted before being used on a machine.

Change the following contents as needed:

  • Tools
  • Cutting parameters
  • Feed rates
  • Clearance height or safe position
  • Machine-specific positions (e.g., with M91)
  • Paths of program calls

Some NC programs depend on the machine kinematics. Adapt these NC programs to your machine kinematics before the first test run.

In addition, test the NC programs using the simulation before the actual program run.

 
Tip

With a program test you determine whether the NC program can be used with the available software options, the active machine kinematics and the current machine configuration.

11 SQL BIND Q881 "Tab_example.Position_Nr"

; Bind Q881 to the "Position_No" column of the "Tab_Example" table

To navigate to this function:

Insert NC function All functions FN SQL table access SQL BIND

The NC function includes the following syntax elements:

Syntax element

Meaning

SQL BIND

Syntax initiator for the BIND SQL command

Parameter

Variable to be bound

Name or Parameter

Table name and table column, separated by . or string parameter with definition

Text or string parameter

Only when binding a variable

Notes

  • Enter the path of the table or a synonym as the table name.
  • Executing SQL statements with SQL EXECUTE

  • During the read and write operations, the control considers only those columns that you have specified by means of the SELECT command. If you specify columns without a binding in the SELECT command, then the control interrupts the read or write operation with an error message.