| ibi Patterns - Search 6.0.0 .NET API |
| NetricsServerInterface.recget Method (String, String[]) |
| See AlsoExample |
![]()
|
Get multiple records from a table.
Namespace: NetricsServerInterface
Assembly: NetricsServerInterface (in NetricsServerInterface.dll)
Syntax
| Visual Basic (Declaration) |
|---|
| Public Function recget( _ ByVal tblName As String, _ ByVal recKeys As String() _ ) As NetricsRecord() |
| C# |
|---|
| public NetricsRecord[] recget( string tblName, string[] recKeys ) |
| C++ |
|---|
| public: array<NetricsRecord>^ recget( String tblName, array<String>^ recKeys ) sealed |
| J# |
|---|
| public NetricsRecord[] recget( string tblName, string[] recKeys ) |
| JScript |
|---|
| public
function recget( tblName : String, recKeys : String[] ) : NetricsRecord[] |
Parameters
- tblName
- The name of the table to get the records from
- recKeys
- The record keys of the records to get
Return Value
An array of NetricsRecords, one per record requested
Exceptions
| Exception Type | Condition |
|---|---|
| NetricsException | If the server indicates an error has occured (Possible errors - TBLNOTFOUND, DUPRECKEYS, EXPECTTBLDESC, EXPECTLIST, EXPECTRECKEY, NOTBLDESC, NORECKEY, RECNOTFOUND, UPDPARAM) |
Remarks
This method should typically be used instead of performing multiple single record "gets" for performance reasons.
Example
This sample shows how to get/read records from an ibi™ Patterns - Search table.
Copy Code
| |
|---|---|
using NetricsServerInterface;
class MyClass {
private static NetricsServerInterface.NetricsServerInterface si = null;
public static void Main()
{
try
{
String host = "localhost";
int port = 5051;
si = new NetricsServerInterface.NetricsServerInterface(host, port);
// Target ibi™ Patterns - Search table
String table = "names";
// Record keys of records to be gotten
String[] recKeys = { "1", "2" };
NetricsRecord[] response = si.recget(table, recKeys);
// keyField of record returned from recget
String keyField = null;
// data fields returned from recget
String[] data = null;
// Write the data out to the console
for (int i = 0; i < response.Length; i++)
{
keyField = response[i].getKey();
data = response[i].getFields();
Console.Write("key=" + keyField + " : Data=" + String.Join(",", data) + "\n");
}
}
catch (NetricsException e)
{
Console.Write(e.getErrorDescription() + "\n");
}
}
}
| |