recadd with no lock key.


Namespace: NetricsServerInterface
Assembly: NetricsServerInterface (in NetricsServerInterface.dll)

Syntax

Visual Basic (Declaration)
Public Function recadd( _ 
   ByVal tblName As String,  _ 
   ByVal src As NetricsTableRecSrc,  _ 
   ByVal doMaxWork As Boolean,  _ 
   ByVal estNumRecs As Integer _ 
) As NetricsTableStats _
    Implements INetricsServerInterface.recadd
C#
public NetricsTableStats recadd(
   string tblName,
   NetricsTableRecSrc src,
   bool doMaxWork,
   int estNumRecs
)
C++
public:
 NetricsTableStats recadd(
   String tblName,
   NetricsTableRecSrc src,
   bool doMaxWork,
   int estNumRecs
) sealed 
J#
public NetricsTableStats recadd(
   string tblName,
   NetricsTableRecSrc src,
   bool doMaxWork,
   int estNumRecs
)
JScript
public  function recadd(
   tblName : String,
   src : NetricsTableRecSrc,
   doMaxWork : bool,
   estNumRecs : int
) : NetricsTableStats

Implements

INetricsServerInterface.recadd

Example

This sample shows how to add records to a table from a csv input file.

 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);
                       // CSV input file of records to be added
                       String file = "c:\\temp\\names.csv";
                       // Target TIBCO Patterns Engine table
                       String table = "names";
                       // Estimated number of records to be added or -1 if not known
                       int estNumRecs = -1;
                       NetricsTableStats response = null;
                       // Set doMaxWork to true if you want to ignore format errors on input file and continue
                       bool doMaxWork=false;
                       // Set the NetricsRecFile to recadd without key from file.
                       NetricsRecFile netricsRecFile = new NetricsRecFile(file);
                       // Set the initalKey for the records being added to 20000
                       netricsRecFile.setInitialKey(20000);
                       // set the record source for the recadd method
                       NetricsCSVRecSrc src = new NetricsCSVRecSrc(netricsRecFile);
                       // Do the recadd
                       response = si.recadd(table, src, doMaxWork, estNumRecs); 
                       Console.WriteLine("Records added: Number of records in table "+table+ " is "+ response.getNumRecs()+".");
                   }
                   catch (NetricsException e)
                   {
                       Console.Write(e.getErrorDescription() + "\n");
                   }
                 }
              }
            

See Also