执行先前使用 cniSqlCreateReadOnlyPathExpression 或 cniSqlCreateModifiablePathExpression 实用程序函数创建的 SQLPathExpression(如 sqlPathExpression 参数中定义的那样)。
CciElement* cniSqlNavigatePath( int* returnCode, CciSqlPathExpression* sqlPathExpression, CciMessage* inputMessageRoot, CciMessage* inputLocalEnvironment, CciMessage* inputExceptionList, CciMessage* outputMessageRoot CciMessage* outputLocalEnvironment, CciMessage* outputExceptionList);
下表显示了 ESQL 路径表达式中所接受的相关名和被访问数据之间的映射。
相关名 | 被访问数据 |
---|---|
Environment | 流的单个 Environment 树。它将由代理确定,并且无需通过此 API 指定。 |
InputLocalEnvironment | cniSqlNavigatePath 的 inputLocalEnvironment 参数 |
OutputLocalEnvironment | cniSqlNavigatePath 的 outputLocalEnvironment 参数 |
InputRoot | cniSqlNavigatePath 的 inputMessageRoot 参数 |
InputBody | InputRoot 的最后一个子代 |
InputProperties | InputRoot.Properties 注: InputRoot.Properties 是 InputRoot 的第一个子代,称为“Properties”
|
OutputRoot | cniSqlNavigatePath 的 outputMessageRoot 参数 |
InputExceptionList | cniSqlNavigatePath 的 inputExceptionList 参数 |
OutputExceptionList | cniSqlNavigatePath 的 outputExceptionList 参数 |
Database | cniCreateReadOnlyPathExpression 或 cniCreateModifyablePathExpression 的 dataSourceName 参数所标识的 ODBC 数据源 |
InputDestinationList | InputLocalEnvironment 的同义词 |
OutputDestinationList | OutputLocalEnvironment 的同义词 |
有关路径的实际可浏览性和有效性的所有其他规则,请参阅 ESQL 字段引用文档。
假设我们已预先创建了 SQLPathExpression(请参阅 cniSqlCreateReadOnlyPathExpression 或 cniSqlCreateModifiablePathExpression 的示例),则可以使用以下代码浏览至目标元素。
CciElement* targetElement = cniSqlNavigatePath( NULL, ((NODE_CONTEXT_ST *)context)->pathExpression, message, destinationList, exceptionList, NULL, /*we do not reference any output trees*/ NULL, NULL);