You are here: Driver Reference > ODBC Driver > Data Retrieval Examples > Query an Oracle Database using the Value Lookup Method

Query an Oracle Database using the Value Lookup Method

This example demonstrates how ClearSCADA might be configured to query data in an Oracle database, using the Value Lookup Method.

Example:

An Oracle database includes the following database table:

Table Name: SCADADATA

ValueId

Value

Time

1

2.5

10:00

2

3.7

10:00

3

11.3

10:00

3

11.4

09:00

3

10.2

08:00

Within ClearSCADA, an ODBC Query is configured to retrieve the ValueId, Value and Time columns of data from the SCADADATA table.

To do this, the ODBC Query is configured to use this SQL query request:

Within ClearSCADA, an ODBC Analog point is configured to return data from the rows in the ValueId column that have a value of 3. To do this, the point is configured to use a Value Lookup Method with these settings:

As the Use All Results check box is selected, this results in the ODBC Analog Point being given the values of 10.2, 11.4, and then 11.3 respectively. (These are the values retrieved, in ascending time stamp order, from the entries in Lookup Column 1 (‘ValueId’) that have a Lookup Value of 3. The point values are retrieved from column 2 (as Value Column = 2) and the time stamps from column 3 (as Timestamp Column = 3).)


ClearSCADA 2015 R2