You are here: Driver Reference > ODBC Driver > Points Used for ODBC Data Transfer > Use an SQL Query to Insert or Update Data in Another Database

Use an SQL Query to Insert or Update Data in Another Database

To update or insert a value into another database using ODBC data transfer methods, you need to send a point control to the other database. The point control executes an SQL statement that specifies the location at which the point value, and optionally the associated time stamp, are to be updated or inserted within the other database.

For a control to be sent to another database in this way:

Example:

An Oracle database includes the following database table:

Table Name: SCADADATA

ValueId

Value

Time

1

3.5

10:15

2

4.7

10:15

3

12.3

10:15

An ODBC Analog point is used to update the value and time stamp for the row where ValueId = 3. To do this, the analog point is configured to use this SQL query command on the Query tab of the OBDC Analog Point Form:

UPDATE SCADADATA SET Value=?, Time=? WHERE ValueID=3

At 10:26, an operator selects the Control pick action for the ODBC Analog point, and specifies a value of 10.4 in the Control window that is displayed. When the control is executed, the data in ValueId row 3 of the Oracle database is updated to display a value of 10.4 with a Time of 10:26.


ClearSCADA 2015 R2