edmiGetMethodSignatureId
EdmiError edmiGetMethodSignatureId(SdaiString methodType
SdaiString methodName,
SdaiString schemaName
SdaiInstance *methodId);
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.
Arguments
Type | Name | Comment |
SdaiString | methodType |
|
SdaiString | 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. If the method is a query function, the method name shall be the name of the query function it self. |
SdaiString | schemaName | If the method is an Express-X Schema Map, this variable shall be the name of the mapping schema. E.g "MySchemaMap". If the method is a query function, this variable shall be the name of the query schema containing the query in question, qualified with the name of the parent Express schema. |
SdaiInstance | methodId | Variable that will receive the instance Id of the method. This is an instance of the EDM_METHOD entity in the ExpressDataManager model |
Return Value
Options
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;
See also