TableResult OpenTable(OdId tOb, OpenTableArg tArg)
tOb. Moniker of the repository object that is a table/external table/view/log.
tArg. Operation execution parameters.
The OpenTable operation opens a table/external table/view/log 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 corresponding repository object, 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. Further work with the opened object instance 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, bool? forEdit)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tOpen = new OpenTable()
{
tArg = new OpenTableArg()
{
args = new TableOpenArgs()
{
openForEdit = (forEdit != null ? forEdit : null)
}
},
tOb = new OdId() { id = mb.id + "!" + FindObjectById(mb, id).k }
};
//Open table
var tResult = somClient.OpenTable(tOpen);
return tResult;
}
See also: