|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Library Reference > Database > DBWQuery |
Given the identifier of a PDM document, it fetches from the DOCUMENT table of the PDM database the value of the assigned field.
Function DBWQuery(ID, FieldName)
id |
name of a document. If spaces are to be included in the name, they must be replaced by '|' characters.The format is "Document|Identifier documentType" where documentType is "A" for Assemblies "P" for Parts "0" for Projects A clarifying example can be found below. |
|---|---|
fieldName |
Identifier of an existing field in the Document table of DBWorks. For writing portable scripts across different localizations of the database, may be better to declare the field using the DBWLookUp function, that accepts as argument an identifier of a standard field. A list of the available identifiers for standard fields follows below: NAME_FIELD_DESCRIPTION description NAME_FIELD_CONFIGURATION configuration |
After calling this function check the boolean value of the okDBW variable:
TRUE |
if succeeded in fetching the value |
|---|---|
FALSE |
otherwise |
If okDBW is TRUE, the function returns the requested value.
DBWQueryByUId
DBWQueryRevisionByUId
' The following example illustrates use of this function for two standard fields and for one custom-defined field.
' Please note that for the custom-defined field the DBWLookUp function is not used.
docId = "Handle|Bar|Complete A"
fName = DBWQuery( docId , DBWLookUp("NAME_FIELD_FILE_NAME") )
fAuthor = DBWQuery( docId , DBWLookUp("NAME_FIELD_CREATED_BY") )
LastModifyBy = DBWQuery( docId, "NAME_FIELD_LAST_MODIFIED_BY" )