...
Returns a querySchemaId that uniquely identifies an EDMquerySchema in the remote EDMdatabase.
Related functions: edmiRemoteGetQuery, edmiRemoteExecuteQuery, edmiRemoteExecuteQueryEx,
Header:
#include "sdai.h"
Prototype:
EdmiError edmiRemoteGetQuerySchema(SdaiServerContext serverContextId,
SdaiString schemaName,
SdaiString querySchemaName,
SdaiQuerySchema *querySchemaId,
SdaiInvocationId *edmiInvocationId);
Arguments:
Code Block | ||||
---|---|---|---|---|
| ||||
EdmiError edmiRemoteGetQuerySchema(SdaiServerContext serverContextId,
SdaiString schemaName,
SdaiString querySchemaName,
SdaiQuerySchema *querySchemaId,
SdaiInvocationId *edmiInvocationId);
|
Returns a querySchemaId that uniquely identifies an EDMquerySchema in the remote EDMdatabase
Arguments
...
Type | Name | Comment |
SdaiServerContext | serverContextId | Context identification, from edmiDefineServerContext |
SdaiString | schemaName | The name of the Express Schema for which the Query Schema has been compiled. This Express Schema must be compiled to form a dictionary model in the _EDMdatabase{_}the EDMdatabase. Express Schema names are case insensitive and unique within the scope of an _EDMdatabase_ .an EDMdatabase |
SdaiString | querySchemaName | The name of the Query Schema for which to retrieve its unique querySchemaId. Query Schema names are case insensitive and unique within the scope of an Express Schema. |
SdaiQuerySchema | querySchemaId | A variable that will receive the numeric querySchemaID that uniquely identifies the Query Schema instance in the remote _EDMdatabase_ .remote EDMdatabase |
SdaiInvocationId | edmiInvocationId | Currently not used. |
...
Return Value
...
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|
Options
...
Example
...
Code Block | ||
---|---|---|
| ||
/* - -------------------------------------- |
...
- File: c:/data/furniture. |
...
exp - -------------------------------------- |
...
SCHEMA Furniture TYPE tScrewType = ENUMERATION OF (PHILIPS, ALLEN, FLAT); END_TYPE; |
...
ENTITY Screw; |
...
Id : STRING; |
...
Typ : tScrewType; |
...
Len : REAL; |
...
Dia : REAL; |
...
END_ENTITY; |
...
ENTITY Dining_Table; |
...
Name : STRING; |
...
Legs : INTEGER; |
...
Len : REAL; |
...
Width : REAL; |
...
Height : REAL; |
...
Screws : BAG OF Screw; |
...
END_ENTITY; |
...
END_SCHEMA; |
...
- --------------------------------------- |
...
- File: c:/data/furniture_query. |
...
qex - --------------------------------------- |
...
QUERY_SCHEMA Furniture_Query FOR Furniture; |
...
GLOBAL DECLARE src INSTANCE OF Furniture; END_GLOBAL; |
...
VIEW_ENTITY View_Table; |
...
Name : STRING; |
...
Area : REAL; |
...
END_VIEW_ENTITY; |
...
QUERY_FUNCTION Dining_Table_Area (Area : REAL) : SET OF View_Table; |
...
LOCAL result : SET of View_Table; |
...
currView : View_Table; |
...
table_area : REAL; |
...
END_LOCAL; |
...
FROM(sdt:src::Dining_Table) |
...
WHEN TRUE; |
...
BEGIN table_area := sdt.Len*sdt.Width; |
...
IF(table_area > Area |
...
) THEN NEW currView; currView.Name := sdt.Name; |
...
currView.Area := table_area; |
...
result ++ currView; |
...
END_IF; |
...
END; |
...
RETURN(result); |
...
END_QUERY_FUNCTION; |
...
END_QUERY_SCHEMA; |
...
*/ |
...
EdmiError rstat; |
...
SdaiInteger nErr, nWrn; |
...
SdaiServerContext myContext; |
...
SdaiQuerySchema qexSchemaId; |
...
SdaiQuery queryId; |
...
/* Define Remote Server Context */ |
...
rstat = edmiDefineServerContext("MyRemoteServerContext", |
...
"Johnny", "Supervisor", "cf37ftr", |
...
"TCP", "9090", "MyServerHost", |
...
NULL, NULL, NULL, NULL, NULL, &myContext); |
...
/* Compile the Express Schema */ |
...
rstat = edmiRemoteDefineSchema(myContext, EXPRESS_SCHEMA_TYPE, |
...
"c:/data/furniture.exp", "c:/temp/furniture.dia", |
...
"Furniture", 0, &nWrn, &nErr, NULL); |
...
/* Compile the Query Schema */ |
...
rstat = edmiRemoteDefineSchema(myContext, QUERY_SCHEMA_TYPE, |
...
"c:/data/furniture_query.qex", "c:/temp/furniture_query.dia", |
...
"Furniture_Query", 0, &nWrn, &nErr, NULL); |
...
/* Get the Query Schema Id */ |
...
rstat = edmiRemoteGetQuerySchema(myContext, "Furniture", |
...
"Furniture_Query", &qexSchemaId, NULL); |
...
printf("\nQuery Schema Id = %d", qexSchemaId); |
...
/* Get the Query Function Id */ |
...
rstat = edmiRemoteGetQuery(myContext, "Furniture", |
...
"Furniture_Query", "Dining_Table_Area", |
...
&queryId, NULL); |
...
printf("\nQuery Function Id = %d", queryId); |
...
. . . |
See also
Filter by label (Content by label) | ||||||
---|---|---|---|---|---|---|
|