Relational Database(rdbms via odbc) Interface


Example 3.5 – Tag Distribution with Aliases in Column Names



Yüklə 1,66 Mb.
səhifə42/50
tarix07.04.2018
ölçüsü1,66 Mb.
#46960
1   ...   38   39   40   41   42   43   44   45   ...   50

Example 3.5 – Tag Distribution with Aliases in Column Names


SQL Statement
(file PI_DIST3.SQL)

SELECT NAME AS PI_TAGNAME, VALUE AS PI_VALUE , STATUS AS PI_STATUS, DATE_TIME AS PI_TIMESTAMP FROM T3_5 WHERE NAME LIKE ?;

Relevant PI Point Attributes

Extended Descriptor

Location1

All points



Location2

All points



Location3


Location4

All points



Location5

All points



Distributor – P1="Key_123%"

Target points - /ALIAS='value retrieved from NAME column'



1

Not evaluated


-1
Not evaluated

1

0

Instrumenttag

Point Type

(Distributor)



Point Source

S











PI_DIST3.SQL

Float32













RDBMS Table Design

Table T3_5

DATE_TIME

NAME

VALUE

STATUS

Datetime (MS SQL Server)

Date/Time (MS Access)



Char(80) (MS SQL Server)

Text(80) (MS Access)



Real (MS SQL Server)

Text(255) (MS Access)



Real (MS SQL Server)

Text(12) (MS Access)


Example 3.6 – RxC Distribution


SQL Statement
(file PI_DIST4.SQL)

SELECT sampletime AS PI_TIMESTAMP1, name1 AS PI_TAGNAME1, value1 AS PI_VALUE1, sampletime AS PI_TIMESTAMP2, name2 AS PI_TAGNAME2, value2 AS PI_VALUE2, status2 AS PI_STATUS2, sampletime AS PI_TIMESTAMP3,name3 AS PI_TAGNAME3, value3 AS PI_VALUE3, status3 AS PI_STATUS3 FROM T3_6 WHERE sampletime > ?;

Relevant PI Point Attributes

Extended Descriptor

Location1

All points



Location2

All points



Location3


Location4

All points



Location5

All points



RxC Distributor: P1=TS

Targets:



1

Not evaluated


-2
Not evaluated

1

0

InstrumentTag

Point Type

(Distributor)



Point Source

S











PI_DIST4.
SQL

Float32













RDBMS Table Design

Table T3_6

SAMPLETIME

NAMEn

VALUEn

STATUSn

Datetime (MS SQL Server)

Date/Time (MS Access)



Char(80) (MS SQL Server)

Text(80) (MS Access)



Real (MS SQL Server)

Number (MS Access)



Real (MS SQL Server)

Number (MS Access)


Example 3.6b – RxC Distribution Using PI_TIMESTAMP Keyword


SQL Statement
(file PI_DIST4.SQL)

SELECT sampletime AS PI_TIMESTAMP, name1 AS PI_TAGNAME1, value1 AS PI_VALUE1, name2 AS PI_TAGNAME2, value2 AS PI_VALUE2, status2 AS PI_STATUS2, name3 AS PI_TAGNAME3, value3 AS PI_VALUE3, status3 AS PI_STATUS3 FROM T3_6b WHERE sampletime > ?;

Yüklə 1,66 Mb.

Dostları ilə paylaş:
1   ...   38   39   40   41   42   43   44   45   ...   50




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©muhaz.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin