Returns the primitive type of the data value that can be assigned to the specified attribute in an instance of a type that contains this attribute.
NOTE: In this context an attribute also represents a view_entity attribute.
The dictionary model that defines the specified attribute must be open before this function can be successfully performed.
Related function: edmiGetAggrPrimitiveType , edmiGetAttrPrimitiveType .
Header:
#include "sdai.h"
Prototype:
EdmiError edmiGetAttrPrimitiveTypeBN(SdaiString schemaName,
SdaiString entityName,
SdaiString attributeName,
SdaiPrimitiveType *dataType);
Arguments:
schemaName |
Specifies the name of an Express schema that defines the attribute of interest. This Express schema must exist as a dictionary model in the EDMdatabase. Schema names are case insensitive. |
entityName |
Specifies the name of the entity or view_entity that defines the attribute of interest. This entity must be defined by the EXPRESS schema specified by the schemaName argument. Entity names are case insensitive. |
attributeName |
Specifies the name of the attribute or view_entity attribute of interest. Attribute names are case insensitive. |
dataType |
Address of the variable that will receive the legal primitive type of data value that can be assigned to the specified attribute. |
Returns:
A completion code of datatype EdmiError is the returned function value. The completion code has the following values:
Completion code = 0 : Operation successfully performed.
Completion code != 0: Error in operation. Completion code is an EDMinterface error code. Use edmiGetErrorText to get the error text corresponding to the error code.
EXAMPLE
EdmiError rstat;
SdaiPrimitiveType dataType;
. . .
if (rstat = edmiGetAttrPrimitiveTypeBN("PDM_Schema",
"Product",
"Description",
&dataType)) {
/* Error in operation */
printf("\nError: %s in edmiGetAttrPrimitiveTypeBN\n",
edmiGetErrorText(rstat));
goto error;
}
switch (dataType) {
case sdaiINTEGER:
. . .
break;
case sdaiREAL:
. . .
break;
case sdaiSTRING:
. . .
break;
case sdaiBOOLEAN:
. . .
break;
case sdaiLOGICAL:
. . .
break;
case sdaiBINARY:
. . .
break;
case sdaiENUMERATION:
. . .
break;
case sdaiINSTANCE:
. . .
break;
case sdaiAGGR:
. . .
break;
case sdaiADB:
. . .
break;
default:
/* Unknown value */
}
. . .