Below is the example of using the GetDbCommand operation to get a data set obtained on executing the Query repository object. The request contains moniker of opened object instance and the pattern indicating whether to get the output data set. The response contains requested information.
{ "GetDbCommand" : { "tDbCommand" : { "id" : "S2!M!S!M1" }, "tArg" : { "pattern" : { "obInst" : "true", "rows" : "true" } } } }
{ "GetDbCommandResult" : { "id" : { "id" : "S2!M!S!M1" }, "meta" : { "obInst" : { "obDesc" : { "@fullUrl" : "\/", "@isShortcut" : "0", "@isLink" : "0", "i" : "OBJ9051", "n" : "Query", "k" : "9051", "c" : "770", "p" : "9050", "h" : "0" } }, "dirty" : "0", "type" : "Query", "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 GetDbCommandResult GetQueryResult(DbCommandId moniker) { var somClient = new SomPortTypeClient(); //Proxy object for operation execution //Operation execution parameters var tGet = new GetDbCommand() { tArg = new GetDbCommandArg() { pattern = new DbCommandMdPattern() { rows = true } }, tDbCommand = moniker }; //Get data var tResult = somClient.GetDbCommand(tGet); return tResult; }
See also: