Deletes a schema from the remote EDMdatabase. The following schema types are supported by this function;
- Express Schemata (ISO10303-11).
- Express-X Schemata (ISO10303-14)
- Express Rule Schemata (Express Schemata extention).
- Express Query Schemata (Express Schemata extention).
For Express Schemata, dictionary models may not be deleted if data models (populations) of it exist in the database. Neither can it be deleted if it has been refered to as a source schema or a target schema by any Express-X dictionary model. Therefore, all corresponding data models and Express-X dictionary models must be deleted before the Express Schema it self may be deleted.
Related functions: edmiRemoteDefineSchema , edmiDeleteSchema
Header:
#include "sdai.h"
Prototype:
EdmiError edmiRemoteDeleteSchema(SdaiServerContext serverContextId,
SdaiInteger schemaType,
SdaiString schemaName,
SdaiString extraSchemaName,
SdaiUnsignedInt options,
SdaiInvocationId *edmiInvocationId);
Arguments:
serverContextId |
Context identification, from edmiDefineServerContext |
schemaType |
The type of schemata to delete. Supported schema types are EXPRESS_SCHEMA_TYPE, RULE_SCHEMA_TYPE, QUERY_SCHEMA_TYPE and EXPRESS_X_SCHEMA_TYPE. |
schemaName |
The name of the schema to delete. If the <schemaType> is RULE_SCHEMA_TYPE or QUERY_SCHEMA_TYPE, this argument shall be the name of the parent Express Schema. |
extraSchemaName |
If the <schemaType> is RULE_SCHEMA_TYPE or QUERY_SCHEMA_TYPE, this argument shall be the name of the Rule Schema or Query Schema. |
options |
Currently not used. |
edmiInvocationId |
Currently not used. |
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 nWrn, nErr;
SdaiServerContext myContext;
SdaiSchema schemaId;
/* Define Remote Server Context */
rstat = edmiDefineServerContext("MyRemoteServerContext",
"Johnny", "Supervisor", "cf37ftr",
"TCP", "9090", "MyServerHost",
NULL, NULL, NULL, NULL, NULL, &myContext);
/* Compile the schema */
rstat = edmiRemoteDefineSchema(myContext, EXPRESS_SCHEMA_TYPE,
"c:/data/MyFile.exp", "c:/tmp/MyFile.dia", "MySchema",
DELETING_EXISTING_SCHEMAS | STORING_SOURCE,
&nWrn, &nErr, NULL);
/* Get the id of schema MySchema */
rstat = edmiRemoteGetSchema(myContext, "MySchema",
&schemaId, NULL);
/* Get the HTML source
of schema MySchema */
rstat = edmiRemoteGetSchemaSource(myContext, EXPRESS_SCHEMA_TYPE,
"MySchema", NULL, SHOW_HTML,
"c:/out/MySchema.html", NULL);
/* Delete the schema */
rstat = edmiRemoteDeleteSchema(myContext, EXPRESS_SCHEMA_TYPE,
"MySchema", NULL, 0, NULL);
. . .