Database Management
Reference Manual
Attributes
:
Query Attributes
: Standard Attribute Query
Standard Attribute Query
An attribute value may be obtained as follows:
Specify the attribute name after QUERY or on the RHS of a PML assignment. This will return the attribute value, if valid, for the CE.
Q XLEN
!A = XLEN
Via a DBREF object using the attribute name as a method, or using the ‘Attribute’ method.
Q var !!CE.XLEN
!A = !!CE.ATTRIBUTE(‘XLEN’)
The querying is the same for UDAs or pseudo attributes.
!RESULT = !!CE. ATTRIBUTE(‘ATTLIS’)
!RESULT = !!CE. ATTRIBUTE(‘:MYUDA’)
The type of the PML variable will depend on the type of the attribute and whether it is an array or not. Attributes of INTEGER type will be assigned to a PML variable of type REAL. Attributes of type WORD are assigned to PML variable of type TEXT.
If the attribute is a DISTANCE attribute and current DISTANCE units are inch or finch, then the value will be converted to inches. If the attribute is a BORE attribute and current BORE units are inch or finch, then the value will be converted to inches.
If the attribute is a REAL attribute and it is defined to be one a physical quantity (distance, angle, mass, whose metal data UNIT is set to a dimensions such as DIST, ANGL, or MASS etc.) then the attribute is returned in the current units of that quantity.
If it is an attribute of volume capacity (CUDI) and the current units are derived from current distance units of INCH or FINCH the value will be reported in cubic inches.
PML1 Syntax
PML1 syntax allows an attribute to be passed to a PML variable without the ‘=’ operator. If this is done then the value will always be formatted to a TEXT using the current units if applicable.
VAR !RESULT XLEN
!RESULT will be of type TEXT
The VAR command has many forms but in all cases it creates PML STRING variables, not Numbers. If the contents are values and numbers then where these are physical quantities they will be appended with the units of the values as stored in the system.
VAR !RESULT XLEN
Will store the text equivalent of the value of the XLEN attribute in current distance units.
Q VAR !!CE.XLEN
Will return the text string form of !!CE.XLEN. It does this by using the STRING (actually queryString) method of the (temporary) real variable created by !!CE.XLEN. The real variable will be created in current units and the STRING method will append the unit qualifier to the value output
<REAL> 18.1102362204724in
Use the OF Syntax
Attributes my be queried on other elements by using the ‘OF’ syntax.
Q XLEN of /MYBOX
!RESULT = XLEN OF /MYBOX
The syntax following the OF may be any ID expression.
!RESULT = XLEN of NEXT BOX
!RESULT = DESC OF CREF.
1974 to current year.
AVEVA Solutions Limited and its subsidiaries. All rights reserved.