×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




They are able to upload 30,000 record an hour using this process.

OK, something is VERY wrong. Granted, it's a contrived example (and
.NET), but I'm getting an effective rate of 1.5 Million rows per hour
from my laptop to our 270. Code and results below...

100000 rows...
Runtime: 00:03:57.6850946
Rows per second: 420.72
Rows per minute: 25,243.48
Rows per 15-minute: 378,652.27
Rows per hour: 1,514,609.07


---Begin Code---

using System;
using System.Collections.Generic;
using System.Text;
using IBM.Data.DB2.iSeries;

namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
iDB2Connection cn = new
iDB2Connection("DataSource=SOL;UserID=WaldenL;Password=xxx;Naming=System
;LibraryList=QTEMP,WALDENL,QGPL");
cn.Open();
Console.WriteLine(cn.JobName);
iDB2Command cm = cn.CreateCommand();
cm.CommandText = "insert into waldenl/test
(fld1, fld2) values(?, ?)";
cm.Parameters.Add(new iDB2Parameter("fld1",
iDB2DbType.iDB2Integer));
cm.Parameters.Add(new iDB2Parameter("fld2",
iDB2DbType.iDB2Char, 30));

int rows = 100000;
DateTime start = DateTime.Now;
for (int i = 1; i <= rows; i++)
{
cm.Parameters["fld1"].Value = i;
cm.Parameters["fld2"].Value =
string.Format("String {0}", i);
cm.ExecuteNonQuery();

if (i % 100 == 0)
Console.WriteLine(i);
}

DateTime stop = DateTime.Now;

TimeSpan runTime = stop - start;

Console.WriteLine(string.Format("Runtime: {0}",
runTime));

double rowsPerSecond =
rows/runTime.TotalSeconds;
Console.WriteLine(string.Format("Rows per
second: {0:n}", rowsPerSecond));
Console.WriteLine(string.Format("Rows per
minute: {0:n}", rowsPerSecond*60));
Console.WriteLine(string.Format("Rows per
15-minute: {0:n}", rowsPerSecond*60*15));
Console.WriteLine(string.Format("Rows per hour:
{0:n}", rowsPerSecond*60*60));


Console.ReadLine();
cn.Close();
return;
}
}
}

----End Code----


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.