DBWQueryByUId

<< Click to Display Table of Contents >>

Navigation:  Programming Mechworks PDM > DBWCommandShell > Library Reference > Database >

DBWQueryByUId

Description

Given the identifier of a DBWorks document, it fetches from the DOCUMENT table of the DBWorks database the value of an assigned field.

Syntax

Function DBWQueryByUid(Uid, FieldName)

Parameters

Uid

the unique id of the document

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
NAME_FIELD_FILE_NAME   file name
NAME_FIELD_FILE_DIRECTORY file direcotory
NAME_FIELD_CREATED_BY   created by
NAME_FIELD_CREATION_DATE   creation date
NAME_FIELD_LAST_MODIFIED_BY last modified by
NAME_FIELD_LAST_MODIFIED_DATE   last modification date
NAME_FIELD_LENGTH   length of part
NAME_FIELD_SURFACE   surface
NAME_FIELD_VOLUME   volume
NAME_FIELD_WEIGHT   weight
NAME_FIELD_MATERIAL   material
NAME_FIELD_SCALE   scale
NAME_FIELD_SHEET_FORMAT   sheet format
NAME_FIELD_NO_OF_SHEETS   number of sheets
NAME_FIELD_ITEM_CODE   item code
NAME_FIELD_CATEGORY   category
NAME_FIELD_SUPPLIER_ID   supplier Id
NAME_FIELD_CLIENT_ID   client Id
NAME_FIELD_COST   cost
NAME_FIELD_MAKE_BUY   make buy list
NAME_FIELD_NOTES   notes
NAME_FIELD_STATE   state
NAME_FIELD_REVISION   revision
NAME_FIELD_ACTIVE_REVISION   active revision
NAME_FIELD_CHECK_OUT_BY    checkout by
NAME_FIELD_CHECK_OUT_DATE   checkout date
NAME_FIELD_FROZEN_BY   frozen by
NAME_FIELD_FROZEN_DATE   frozen by
NAME_FIELD_UPDATE_STAMP   update stamp

Return Values

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.

See also

Function DBWQuery
Function DBWQueryRevisionByUid

Example

docUId = 24
fName = DBWQueryByUid( docUId , "FILE_NAME" )
if (okDBW = False) then exit sub