Result GetDatabaseData(OdId tOb, GetDatabaseDataArg tArg)
tOb. Moniker of repository object that is database.
tArg. Operation execution parameters.
The GetDatabaseData operation gets information about database and its tables.
To execute the operation, in the tOb field specify moniker of the repository object that is a database, and in the tArg field specify the pattern that will be used to get information. The object moniker can be obtained on executing the GetObjects operation.
The operation results in the obtained information about the database.
Below is the example of getting information about the database and its tables. The request contains database moniker in the repository. The response contains the driver used by the database, use of automatic connection, and the list of physical table names stored on DBMS server.
The example uses the FindObjectById function, which code is given in the Getting Object Description by Its Identifier example.
{
"GetDatabaseData" :
{
"tOb" :
{
"id" : "GDDDOLIINILHGOAEPLFHMCEACBLGJGHEAKHGLPEKDKEIIJNJ!M!52"
},
"tArg" :
{
"dataGet" :
{
"driver" : "true",
"loginPrompt" : "true",
"tables" : "true"
}
}
}
}
{
"GetDatabaseDataResult" :
{
"data" :
{
"driver" : "POSTGRES",
"loginPrompt" : "0",
"tables" :
{
"its" :
{
"it" :
[
{
"name" : "b_du"
},
{
"name" : "b_jau"
},
{
"name" : "obj132"
},
{
"name" : "obj133"
},
{
"name" : "obj162"
},
{
"name" : "obj200data"
},
{
"name" : "obj634"
},
{
"name" : "obj6460"
},
{
"name" : "obj6464"
},
{
"name" : "obj6466"
},
{
"name" : "obj6476"
},
{
"name" : "obj6537"
},
{
"name" : "obj6561"
},
{
"name" : "obj6602"
},
{
"name" : "obj664"
},
{
"name" : "t141"
},
{
"name" : "t158"
},
{
"name" : "t160"
},
{
"name" : "t203"
},
{
"name" : "t206"
},
{
"name" : "t568"
},
{
"name" : "t569"
},
{
"name" : "t627"
},
{
"name" : "t630"
},
{
"name" : "t642"
},
{
"name" : "t6426"
},
{
"name" : "t644"
},
{
"name" : "t646"
},
{
"name" : "t6478"
},
{
"name" : "t6480"
},
{
"name" : "t6532"
},
{
"name" : "t6535"
},
{
"name" : "t655"
},
{
"name" : "t6554"
},
{
"name" : "t6557"
},
{
"name" : "t657"
},
{
"name" : "t_month"
},
{
"name" : "t_quarter"
},
{
"name" : "t_sep"
},
{
"name" : "t_source"
},
{
"name" : "t_to"
},
{
"name" : "t_year"
}
]
}
}
}
}
}
public static GetDatabaseDataResult GetDatabaseData(MbId mb, string id)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tGet = new GetDatabaseData()
{
tArg = new GetDatabaseDataArg()
{
dataGet = new DatabaseDataPattern()
{
driver = true,
loginPrompt = true,
tables = true
}
},
tOb = new OdId() { id = mb.id + "!" + FindObjectById(mb, id).k }
};
// Get database information
var tResult = somClient.GetDatabaseData(tGet);
return tResult;
}
See also: