EssDeleteVariable

代替変数を削除します。

構文

            ESS_FUNC_M EssDeleteVariable (
            hCtx, pVariable
            );
         
パラメータデータ型説明

hCtx

ESS_HCTX_T

APIへのコンテキスト・ハンドル。

pVariable

ESS_VARIABLE_T

削除される代替変数の説明を含む構造体を指すポインタ。

戻り値

成功の場合、ゼロが戻されます。

         /*
** ESS_DeleteVariable() deletes a substitution variable using
** the API EssDeleteVariable.
*/
ESS_FUNC_M
ESS_DeleteVariable (ESS_HCTX_T hCtx)
{
   ESS_FUNC_M       sts = ESS_STS_NOERR;
   ESS_VARIABLE_T  Variable; 
   ESS_PVARIABLE_T pVariables;
   ESS_ULONG_T     ulCount, i;
   printf("\n ******************************************");
   printf("\n **** An example of using EssDeleteVariable");
   printf("\n ******************************************");

   strcpy(Variable.VarName, "QuarterName"); 
   strcpy(Variable.Server,  "Local"); 
   strcpy(Variable.AppName, "Sample"); 
   strcpy(Variable.DbName,  "Basic"); 
   sts = EssDeleteVariable(hCtx, &Variable);
   if (sts == ESS_STS_NOERR)
     printf("\n Variable 'QuarterName' at the Server/App/Db level is deleted");
   if (sts == ESS_STS_NOERR)
   {
     strcpy(Variable.VarName, "MarketName"); 
     strcpy(Variable.Server,  "Local"); 
     strcpy(Variable.AppName, "Sample"); 
     strcpy(Variable.DbName,  ""); 
     sts = EssDeleteVariable(hCtx, &Variable);
     if (sts == ESS_STS_NOERR)
         printf("\n Variable 'MarketName' at the Server/App level is deleted");
   }
  
   if (sts == ESS_STS_NOERR)
   {
     strcpy(Variable.VarName, "MarketName"); 
     strcpy(Variable.Server,  "Local"); 
     strcpy(Variable.AppName, ""); 
     strcpy(Variable.DbName,  ""); 
     sts = EssDeleteVariable(hCtx, &Variable);
     if (sts == ESS_STS_NOERR)
         printf("\n Variable 'MarketName' at the Server level is deleted");
   }

   /*********************************************************/ 
   /* List the variables at the level of the Server/App/Db- */
   /* We should not have any                                */
   /*********************************************************/ 
   if (sts == ESS_STS_NOERR)
   {
     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);
        }
     }
   }
   /*********************************************************/ 
   /* List the variables - at the level of the App          */ 
   /*********************************************************/ 
 
   if (sts == ESS_STS_NOERR)
   {
     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 server level                    */
   /*********************************************************/ 
   if (sts == ESS_STS_NOERR)
   {
     strcpy(Variable.Server,  "local"); 
     strcpy(Variable.AppName, ""); 
     strcpy(Variable.DbName,  "");
     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 EssDeleteVariable\n\n\n");
   else
      printf("\n --> Error in EssDeleteVariable number: %d\n\n\n", sts); 
   return (sts);
} /* end ESS_DeleteVariable */
      

出力

          ******************************************
 **** An example of using EssDeleteVariable
 ******************************************
 Variable 'QuarterName' at the Server/App/Db level is deleted
 Variable 'MarketName' at the Server/App level is deleted
 Variable 'MarketName' at the Server level is deleted
--- Number of Substitution Variables at the Server, App and Db level is: 0
--- Number of Substitution Variables at the Server and App level is: 0
--- Number of Substitution Variables at the Server level is: 0
 --> No Errors in EssDeleteVariable 
      

関連トピック