OpenTable

Syntax

TableResult OpenTable(OdId tOb, OpenTableArg tArg)

Parameters

tOb. Moniker of the repository object that is table/external table/view.

tArg. Operation execution parameters.

Description

The OpenTable operation opens table/external table/view and returns context for working with it.

Comments

The operation enables the user to get 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.

Example

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.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<OpenTable xmlns="http://www.fsight.ru/PP.SOM.Som">
<tOb xmlns="">
  <id>S1!M!9053</id>
  </tOb>
<tArg xmlns="">
<args>
  <openForEdit>true</openForEdit>
  </args>
  </tArg>
  </OpenTable>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<OpenTableResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<id xmlns="">
  <id>S1!M!S!TABLE5</id>
  </id>
  </OpenTableResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"OpenTable" :
{
"tOb" :
{
"id" : "S1!M!9053"
},
"tArg" :
{
"args" :
{
"openForEdit" : "true"
}
}
}
}

JSON response:

{
"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:

Working with Relational Objects of Repository