Tables where the primary key has multiple records
- Last UpdatedJan 13, 2023
- 1 minute read
- PI System
- PI Server
In some tables, a given primary key might have multiple records. For example, in the attribute set table, PIATRSET, the primary key is SET. However, there are many attributes in a given attribute set. This is essentially a table within a table, so you must tell piconfig to output all records in a given attribute set. In the following example, the command outputs all attributes for each entry in the table, then the command tells piconfig to repeat on each primary key entry until all records have been output. Without specifying this output repeat, only the first attribute would be returned.
* (Ls - ) PICONFIG> @tabl piatrset
* (Ls - PIATRSET) PICONFIG> @ostr *
* (Ls - PIATRSET) PICONFIG> @ostr ...
* (Ls - PIATRSET) PICONFIG> @sele SET=Base
* (Ls - PIATRSET) PICONFIG> @ends
base,descriptor,,String
base,exdesc,,String
base,typicalvalue,50.,Float32
base,engunits,,String
base,zero,0.,Float32
base,span,100.,Float32
base,pointtype,12,UBYTE
base,pointsource,Lab,String
base,scan,1,BYTE
base,excmin,0,Uint16
base,excmax,600,Uint32
base,excdev,0.1,Float32
base,shutdown,1,BYTE
base,archiving,1,BYTE
base,compressing,1,BYTE
base,step,0,BYTE
base,compmin,0,Uint16
base,compmax,28800,Uint32
base,compdev,0.2,Float32
base,creationdate,31-Dec-69 19:00:00,TimeStamp
base,creator,PIUserIncompatible,String
base,changedate,31-Dec-69 19:00:00,TimeStamp
base,changer,PIUserIncompatible,String
base,displaydigits,-5,BYTE
base,digitalset,,String
* End Repeat...
The next example shows how to specify a repeat, but this time uses a single output structure command, .
* (Ls - ) PICONFIG> @tabl piatrset
* (Ls - PIATRSET) PICONFIG> @ostr set,attrib,...
* (Ls - PIATRSET) PICONFIG> @sele set=base
* (Ls - PIATRSET) PICONFIG> @ends
base,descriptor,exdesc,typicalvalue,engunits,zero,span,pointtype,pointsource,
scan,excmin,excmax,excdev,shutdown,archiving,compressing,step,compmin,compmax,
compdev,creationdate,creator,changedate,changer,displaydigits,digitalset