skip to main content
OpenAccess SDK SQL engine and IP interaction : Example database
 

Example database

This example has a current value table that is called CURVALUE and has schema as defined in the following table.
 
Table 4: Schema of the CURVALUE table
Column Name
Description
NAME
Name of the tag (primary key)
INTVAL
Integer value
FLOATVAL
Floating point value
TIME
The time the data was collected
Assume the following values in the database:
 
NAME
INTVAL
FLOATVAL
TIME
SCOTT
1
100.0
1999-12-10 12:00:30
TOM
1
101.0
1910-01-01 15:00:00
BOB
2
100.0
2010-02-02 01:00:00
xxx
x
x
2000-01-01 09:00:00
JOE
4
102.0
Joe who?
It is assumed that data in the CURVALUE table can be accessed in the following ways:
A row of data can be retrieved by specifying a value for NAME
A list of NAME values can be retrieved by specifying a pattern to match
Assume that no other way of locating and accessing the data is available and assume that you want to perform the following query on this data source:
SELECT NAME, VALUE FROM CURVALUE WHERE (NAME=SCOTT OR NAME=TOM OR NAME=JOE)
AND FLOATVAL > 100.0
The result of this query should be:
 
NAME
FLOATVAL
TOM
101.0
JOE
102.0
First, you learn about the processing performed by the OpenAccess SDK SQL engine and the IP to implement this query without doing any optimization. Then, you learn about the processing performed by the OpenAccess SDK SQL engine and the IP to implement this query with optimization. These two examples give you an idea as to how the OpenAccess SDK SQL engine and the IP work together to execute a query.