|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Library Reference > Database > DBWQueryTableFieldByKey |
This function provides a general way to access database information, not trusting on ADO method.
It is very useful when fetching data from other tables than DOCUMENTS/REVISION.
Function DBWQueryTableFieldByKey(tableName, keyName, keyValue, fieldName)
tableName |
the name of a database table |
|---|---|
keyName |
the value of the field to filter on |
keyValue |
the value that has to match the Keyname parameter |
fieldName |
the field of which retrieve the value |
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.
Function DBWQuery
Function DBWQueryRevisionByUid
Sub main()
DBWInit(TRUE)
tableName = "EVENT_LOG"
keyName = "EVENTID"
keyValue = "683"
fieldName = "ACTION_ARG"
res = DBWQueryTableFieldByKey(tableName, keyName, keyValue, fieldName)
if (okDBW = False) Then
exit Sub
Else
DBWMsgbox res
End if
End Sub