TableResult OpenTable(OdId tOb, OpenTableArg tArg)
tOb. Moniker of the repository object that is table/external table/view.
tArg. Operation execution parameters.
The OpenTable operation opens table/external table/view and returns context for working with it.
The operation gets access to the structure of table, external table or view and also to the data sets stored in these objects. To execute the operation, in the tOb field specify moniker of the repository that is table/external table/view, and in the tArg field specify opening parameters. In the tArg.metaGet field specify parameters for getting metadata. The operation results in the moniker of opened object instance and also requested metadata if the appropriate pattern was specified on executing the operation. The further work with the opened instance of table/external table/view is executed using the GetTable and SetTable operations. To close the opened object instance, use the CloseTable operation.
The example of opening table for edit. The request contains table moniker in the repository. The response contains moniker of opened table instance.
The C# example uses the FindObjectById function, which code is given in the Getting Object Description by Its Identifier section.
{
"OpenTable" :
{
"tOb" :
{
"id" : "S1!M!9053"
},
"tArg" :
{
"args" :
{
"openForEdit" : "true"
}
}
}
}
{
"OpenTableResult" :
{
"id" :
{
"id" : "S1!M!S!TABLE5"
}
}
}
public static TableResult OpenTable(MbId mb, string id)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tOpen = new OpenTable()
{
tArg = new OpenTableArg()
{
args = new TableOpenArgs()
{
openForEdit = true
}
},
tOb = new OdId() { id = mb.id + "!" + FindObjectById(mb, id).k }
};
//Open table
var tResult = somClient.OpenTable(tOpen);
return tResult;
}
See also: