SELECT PI_TIMESTAMP, PI_VALUE, PI_STATUS FROM T3_7;
Relevant PI Point Attributes
Extended
Descriptor
Location1
Location2
Location3
Location4
Location5
/EVENT=sinusoid
1
0
0
Not evaluated
0
InstrumentTag
Point Type
Point Source
PI_EVENT.SQL
String
S
RDBMS Table Design
Table T3_7
PI_TIMESTAMP
PI_VALUE
PI_STATUS
Datetime
(MS SQL Server)
Date/Time
(MS Access)
Varchar(1000)
(MS SQL Server)
Text(255)
(MS Access)
Smallint
(MS SQL Server)
Byte
(MS Access)
Example 3.8 – Multi Statement Query
SQL Statement
(file PI_MULTI.SQL)
INSERT INTO T3_8 (PI_TIMESTAMP, PI_VALUE, PI_STATUS) VALUES (?, ?, ?);
DELETE FROM T3_8 WHERE PI_TIMESTAMP < ?;
Relevant PI Point Attributes
Extended Descriptor
Location1
Location2
Location3
Location4
Location5
P1=TS
P2=VL
P3=SS_I
P4=TS
1
0
0
0
0
InstrumentTag
Point Type
Source Tag
Point Source
PI_MULTI.SQL
Float32
SINUSOID
S
RDBMS Table Design
Table T3_8
PI_TIMESTAMP
PI_VALUE
PI_STATUS
Datetime (MS SQL Server)
Date/Time (MS Access)
SmallInt (MS SQL Server)
Number-Whole Number (MS Access)
Smallint (MS SQL Server)
Number Single Precision (MS Access)
Example 3.9 – Stored Procedure Call
SQL Statement
{CALL SP_T3_9(?,?)};
Stored procedure definition
CREATE PROCEDURE SP3_9 @Start_Time DateTime, @End_Time DateTime AS
SELECT PI_TIMESTAMP,PI_VALUE,PI_STATUS FROM T3_9 WHERE PI_TIMESTAMP BETWEEN @Start_Time AND @End_Time