Returns the instance of EDM_METHOD in the ExpressDataManager model that describes a given method.
A method is either an Express-X Schema Map or a query function.
Related functions: edmiDefineMethodSignature, edmiDeleteMethodSignature, edmiDeleteMethodSignatureBN, edmiGetMethodSignature , edmiModifyMethodSignature edmiListMethodSignatures, edmiGetMethodSignatureBN.
Header:
#include "sdai.h"
Prototype:
EdmiError edmiGetMethodSignatureId(SdaiString methodType
SdaiString methodName,
SdaiString schemaName
SdaiInstance *methodId);
Arguments:
methodType |
"XPX" if the method is an Express-X Schema Map. |
methodName |
If the method is an Express-X Schema Map, this shall be the method name that was assigned to the method when it was defined with edmiDefineMethodSignature. |
schemaName |
If the method is an Express-X Schema Map, this variable shall be the name of the mapping schema. E.g "MySchemaMap". |
methodId |
Variable that will receive the instance Id of the method. This is an instance of the EDM_METHOD entity in the ExpressDataManager model |
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;
SdaiInteger nErr, nWrn;
SdaiInstance qexMethodId;
/* Define Schemas */
rstat = edmiDefineSchema("c:/data/person.exp",
"c:/temp/person.dia",
"Person", 0, &nWrn, &nErr);
rstat = edmiDefineQuerySchema("c:/data/person_queries.qex",
"c:/data/person_queries.dia",
0, &nWrn, &nErr);
/* Get Signature Ids */
rstat = edmiGetMethodSignatureId("QEX", "SexHeavierThan",
"Person.Queries", &qexMethodId);
. . .
Express Schema
– --------------------------------------------------------------
– File : c:/data/person.exp
– --------------------------------------------------------------
SCHEMA person;
ENTITY aperson;
name : STRING;
sex : STRING;
weight : REAL;
END_ENTITY;
END_SCHEMA;
Query Schema.
– --------------------------------------------------------------
– File : c:/data/person_queries.qex
– --------------------------------------------------------------
QUERY_SCHEMA queries FOR person;
GLOBAL
DECLARE src INSTANCE OF person;
END_GLOBAL;
VIEW_ENTITY PersonView;
name : STRING;
sex : INTEGER;
weight : REAL;
END_VIEW_ENTITY;
QUERY_FUNCTION SexHeavierThan ( p_sex:INTEGER; p_weight:REAL)
: SET OF PersonView;
LOCAL
result : SET of PersonView;
currView : PersonView;
END_LOCAL;
FROM(s:src::aperson)
WHEN TRUE;
BEGIN
IF((s.sex = p_sex) AND (s.weight > p_weight)) THEN
NEW currView;
currView.name := s.name;
currView.sex := s.sex;
currView.weight := s.weight;
result ++ currView;
END_IF;
END;
RETURN(result);
END_QUERY_FUNCTION;
END_QUERY_SCHEMA;