MicroStrategy ONE

Execute

Executes a Command Manager statement and returns the exit code of the execution result. The results of any LIST statements are discarded. To capture the results of LIST statements, use the executeCapture statement.

Copy
protected int execute(iString)

where:

iString is the Command Manager statement to be executed. This statement can contain both literal strings enclosed in double quotes (") and variables, concatenated with the + operator.

Example

This sample code uses the execute function to create fifty users, with names qa1 through qa50.

Copy
int i = 1;while(i = 50)
{
  String lUserName = "
  if (execute("CREATE USER \"" + lUserName + "\";") ==
  {
    printOut("User " +
  }
  else
  {
    printErr("Failed creating user " +
  }
  i = i + 1;
}