入力基準に従って、サーバー、アプリケーション、データベース・レベルの代替変数をリストします。
構文
ESS_FUNC_M EssListVariables (
hCtx, pCriteria, pNumVars, ppVarList
);
パラメータ | データ型 | 説明 |
---|---|---|
hCtx |
ESS_HCTX_T |
APIコンテキスト・ハンドル。 |
pCriteria |
ESS_VARIABLE_T |
リストされた代替変数の説明を含む構造体を指すポインタ。
|
pNumVars |
ESS_PULONG_T |
ppVarListパラメータに戻される変数の数を示す、符号なしlong値を指すポインタ。 |
ppVarList |
ESS_VARIABLE_T |
代替変数構造体の配列へのポインタ。呼出し元はEssFreeを呼び出して、この配列を解放する必要があります。 |
戻り値
成功の場合、ゼロが戻されます。
例
/* ** ESS_ListVariables() lists the substitution variables using ** the API EssListVariables. */ ESS_FUNC_M ESS_ListVariables (ESS_HCTX_T hCtx) { ESS_FUNC_M sts = ESS_STS_NOERR; ESS_PVARIABLE_T pVariables; ESS_ULONG_T ulCount, i; ESS_VARIABLE_T Variable; printf("\n *****************************************"); printf("\n **** An example of using EssListVariables"); printf("\n *****************************************"); /*****************************************************************/ /* List Variables at the level of the Server/App/Db */ /* Variables under that specific server will be listed */ /* Variables under that specific server/ App will be listed */ /* Variables under that specific server/ App /DB will be listed */ /*****************************************************************/ strcpy(Variable.VarName, ""); // ignored by EssListVariables strcpy(Variable.Server, "local"); strcpy(Variable.AppName, "Sample"); strcpy(Variable.DbName, "Basic"); sts = EssListVariables(hCtx, &Variable, &ulCount, &pVariables); if (sts == ESS_STS_NOERR) { printf("\n--- Number of Substitution Variables at the Server, App and Db level is: %ld\n", ulCount); for (i = 0; i < ulCount; i++) { printf("Variable name : %s\n", pVariables[i].VarName); printf("Server name : %s\n", pVariables[i].Server); printf("Application name : %s\n", pVariables[i].AppName); printf("Database name : %s\n", pVariables[i].DbName); printf("Variable value : %s\n\n", pVariables[i].VarValue); } } /****************************************************************/ /* Variables under that specific Server will be listed */ /* Variables under that specific Server/App will be listed */ /****************************************************************/ if (sts == ESS_STS_NOERR) { strcpy(Variable.VarName, ""); // ignored by EssListVariables strcpy(Variable.Server, "local"); strcpy(Variable.AppName, "Sample"); strcpy(Variable.DbName, ""); sts = EssListVariables(hCtx, &Variable, &ulCount, &pVariables); if (sts == ESS_STS_NOERR) { printf("\n--- Number of Substitution Variables at the Server and App level is: %ld\n", ulCount); for (i = 0; i < ulCount; i++) { printf("Variable name : %s\n", pVariables[i].VarName); printf("Server name : %s\n", pVariables[i].Server); printf("Application name : %s\n", pVariables[i].AppName); printf("Database name : %s\n", pVariables[i].DbName); printf("Variable value : %s\n\n", pVariables[i].VarValue); } } } /***************************************************************/ /* List Variables at the level of the Server */ /***************************************************************/ if (sts == ESS_STS_NOERR) { strcpy(Variable.VarName, ""); // ignored by EssListVariables strcpy(Variable.Server, "local"); strcpy(Variable.AppName, ""); strcpy(Variable.DbName, ""); if (sts == ESS_STS_NOERR) sts = EssListVariables(hCtx, &Variable, &ulCount, &pVariables); if (sts == ESS_STS_NOERR) { printf("\n--- Number of Substitution Variables at the Server level is: %ld\n", ulCount); for (i = 0; i < ulCount; i++) { printf("Variable name : %s\n", pVariables[i].VarName); printf("Server name : %s\n", pVariables[i].Server); printf("Application name : %s\n", pVariables[i].AppName); printf("Database name : %s\n", pVariables[i].DbName); printf("Variable value : %s\n\n", pVariables[i].VarValue); } } } if (sts == ESS_STS_NOERR) printf("\n --> No Errors in EssListVariables\n\n\n"); else printf("\n --> Error in EssListVariables number: %d\n\n\n", sts); return (sts); } /* end ESS_ListVariables */
出力
***************************************** **** An example of using EssListVariables ***************************************** --- Number of Substitution Variables at the Server, App and Db level is: 3 Variable name : QuarterName Server name : local Application name : Sample Database name : Basic Variable value : Qtr2 Variable name : MarketName Server name : local Application name : Sample Database name : Variable value : East Variable name : MarketName Server name : local Application name : Database name : Variable value : Market --- Number of Substitution Variables at the Server and App level is: 2 Variable name : MarketName Server name : local Application name : Sample Database name : Variable value : East Variable name : MarketName Server name : local Application name : Database name : Variable value : Market --- Number of Substitution Variables at the Server level is: 1 Variable name : MarketName Server name : local Application name : Database name : Variable value : Market --> No Errors in EssListVariables
関連トピック