GetTable

Syntax

TableResult GetTable(OdId tOb, GetTableArg tArg)

Parameters

tOb. Moniker of repository object that is table, external table or view.

tArg. Operation execution parameters.

Description

The GetTable operation gets metadata of table/external table/view.

Comments

The operation gets information about structure of table/external table/view and about the data sets stored in these objects. To execute the operation, in the tOb field specify moniker of opened object instance, and in the tArg field specify parameters for getting metadata. The moniker can be obtained on executing the OpenTable operation. The operation results in the requested metadata.

Example

The example of getting information about physical name, table fields and also the data set stored in the table. The request contains moniker of opened table instance and the pattern that determines whether it is necessary to get this information. The response contains requested information.

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">
<GetTable xmlns="http://www.fsight.ru/PP.SOM.Som">
<tOb xmlns="">
  <id>S1!M!S!TABLE5</id>
  </tOb>
<tArg xmlns="">
<pattern>
  <obInst>true</obInst>
  <nativName>true</nativName>
  <fields>Get</fields>
  <rows>Get</rows>
  </pattern>
  </tArg>
  </GetTable>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<GetTableResult 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>
<meta xmlns="">
<obInst>
<obDesc ds="" isShortcut="0" isLink="0" ver="20" hf="0">
  <i>T_COUNTRY_INFO</i>
  <n>Data by countries</n>
  <k>9053</k>
  <c>769</c>
  <p>9050</p>
  <h>0</h>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  <isPermanent>1</isPermanent>
  <isTemp>0</isTemp>
  </obDesc>
  <openArgs />
  </obInst>
  <nativName>T_COUNTRY</nativName>
<fields>
<its>
<it>
  <k>1</k>
  <id>ISO_CODE</id>
  <n>ISO country code</n>
  <vis>1</vis>
  <dt>1</dt>
  <mandatory>1</mandatory>
  <defaultValue />
  <size>255</size>
  <precision>0</precision>
  <isCalculated>0</isCalculated>
  </it>
<it>
  <k>2</k>
  <id>NAME</id>
  <n>Name</n>
  <vis>1</vis>
  <dt>1</dt>
  <mandatory>1</mandatory>
  <defaultValue />
  <size>255</size>
  <precision>0</precision>
  <isCalculated>0</isCalculated>
  </it>
<it>
  <k>3</k>
  <id>POPULATION</id>
  <n>Population</n>
  <vis>1</vis>
  <dt>3</dt>
  <mandatory>0</mandatory>
  <defaultValue />
  <size>20</size>
  <precision>2</precision>
  <isCalculated>0</isCalculated>
  </it>
<it>
  <k>4</k>
  <id>AREA</id>
  <n>Area</n>
  <vis>1</vis>
  <dt>3</dt>
  <mandatory>0</mandatory>
  <defaultValue />
  <size>20</size>
  <precision>2</precision>
  <isCalculated>0</isCalculated>
  </it>
<it>
  <k>5</k>
  <id>CURRENCY</id>
  <n>Currency</n>
  <vis>1</vis>
  <dt>1</dt>
  <mandatory>0</mandatory>
  <defaultValue />
  <size>255</size>
  <precision>0</precision>
  <isCalculated>0</isCalculated>
  </it>
  </its>
  </fields>
<rows>
<its>
<r>
  <it>RU</it>
  <it>Russia</it>
  <it>143666931</it>
  <it>17125187</it>
  <it>Russian ruble (RUB)</it>
  </r>
<r>
  <it>US</it>
  <it>United States of America</it>
  <it>320194478</it>
  <it>9519431</it>
  <it>United States dollar ($) (USD)</it>
  </r>
  </its>
  </rows>
  </meta>
  </GetTableResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"GetTable" :
{
"tOb" :
{
"id" : "S1!M!S!TABLE5"
},
"tArg" :
{
"pattern" :
{
"obInst" : "true",
"nativName" : "true",
"fields" : "Get",
"rows" : "Get"
}
}
}
}

JSON response:

{
"GetTableResult" :
{
"id" :
{
"id" : "S1!M!S!TABLE5"
},
"meta" :
{
"obInst" :
{
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "20",
"@hf" : "0",
"i" : "T_COUNTRY_INFO",
"n" : "Data by countries",
"k" : "9053",
"c" : "769",
"p" : "9050",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"isPermanent" : "1",
"isTemp" : "0"
},
"openArgs" : ""
},
"nativName" : "T_COUNTRY",
"fields" :
{
"its" :
{
"it" :
[
{
"k" : "1",
"id" : "ISO_CODE",
"n" : "ISO country code",
"vis" : "1",
"dt" : "1",
"mandatory" : "1",
"defaultValue" : "",
"size" : "255",
"precision" : "0",
"isCalculated" : "0"
},
{
"k" : "2",
"id" : "NAME",
"n" : "Name",
"vis" : "1",
"dt" : "1",
"mandatory" : "1",
"defaultValue" : "",
"size" : "255",
"precision" : "0",
"isCalculated" : "0"
},
{
"k" : "3",
"id" : "POPULATION",
"n" : "Population",
"vis" : "1",
"dt" : "3",
"mandatory" : "0",
"defaultValue" : "",
"size" : "20",
"precision" : "2",
"isCalculated" : "0"
},
{
"k" : "4",
"id" : "AREA",
"n" : "Area",
"vis" : "1",
"dt" : "3",
"mandatory" : "0",
"defaultValue" : "",
"size" : "20",
"precision" : "2",
"isCalculated" : "0"
},
{
"k" : "5",
"id" : "CURRENCY",
"n" : "Currency",
"vis" : "1",
"dt" : "1",
"mandatory" : "0",
"defaultValue" : "",
"size" : "255",
"precision" : "0",
"isCalculated" : "0"
}
]
}
},
"rows" :
{
"its" :
{
"r" :
[
{
"it" :
[
"RU",
"Russia",
"143666931",
"17125187",
"Russian ruble (RUB)"
]
},
{
"it" :
[
"US",
"United States of America",
"320194478",
"9519431",
"United States dollar ($) (USD)"
]
}
]
}
}
}
}
}
public static TableResult GetTableMetadata(string moniker)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tGet = new GetTable()
{
tArg = new GetTableArg()
{
pattern = new TableMdPattern
{
fields = ListOperation.Get,
nativName = true,
rows = ListOperation.Get
}
},
tOb = new OdId() { id = moniker }
};
//Get metadata
var tResult = somClient.GetTable(tGet);
return tResult;
}

See also:

Working with Relational Objects of Repository