Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

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.
"QEX" if the method is a query function.

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.

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. E.g: "MySchema.MyQuerySchema"
SchemaMap, ExpressSchema, QuerySchema

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;

  • No labels