Note that there are some explanatory texts on larger screens.

plurals
  1. POOracleBulkCopy error: '0' is not a valid value for 'Interval'
    primarykey
    data
    text
    <p>I have the following code</p> <pre><code> using (OracleConnection srcConn = new OracleConnection()) using (OracleConnection destConn = new OracleConnection()) { srcConn.ConnectionString = AppInfo.SrcConnStr; srcConn.Open(); destConn.ConnectionString = AppInfo.DestConnStr; destConn.Open(); using (OracleCommand destCmd = new OracleCommand("ALTER SESSION SET NLS_DATE_FORMAT = 'yyyy-mm-dd hh24:mi:ss'", destConn)) using (OracleCommand srcCmd = new OracleCommand("ALTER SESSION SET NLS_DATE_FORMAT = 'yyyy-mm-dd hh24:mi:ss'", srcConn)) { // Non-query srcCmd.ExecuteNonQuery(); destCmd.ExecuteNonQuery(); if (Timing) { ut.TimeIt(stopwatch, "Get Connection and Command"); } srcCmd.CommandTimeout = 0; destCmd.CommandTimeout = 0; srcCmd.CommandText = "select * from table_name"; rd = srcCmd.ExecuteReader(); rd.FetchSize = rd.RowSize * AppInfo.BatchSize; } OracleBulkCopy copy = new OracleBulkCopy(destConn); copy.DestinationTableName = DestTable; copy.BatchSize = AppInfo.BatchSize; copy.NotifyAfter = AppInfo.BatchSize; copy.OracleRowsCopied += new OracleRowsCopiedEventHandler(OnOracleRowsCopied); copy.BulkCopyTimeout = AppInfo.CommandTimeOut; copy.WriteToServer(rd); } } </code></pre> <p>When it got to copy.WriteToServer(rd); it gives the following error</p> <pre><code> System.ArgumentException was caught Message='0' is not a valid value for 'Interval'. 'Interval' must be greater than 0. Source=System StackTrace: at System.Timers.Timer.set_Interval(Double value) at Oracle.DataAccess.Client.OracleBulkCopy.PerformBulkCopy() at Oracle.DataAccess.Client.OracleBulkCopy.WriteDataSourceToServer() at Oracle.DataAccess.Client.OracleBulkCopy.WriteToServer(IDataReader reader) </code></pre> <p>My question is, How do I fix it?</p> <p>Any help is appreciated.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload