13
當我使用我的C#代碼運行pl/sql查詢[通過存儲過程]時,出現錯誤: 如何解決相同的問題?請指教。 注意:我在代碼中傳遞了providerSpecificTypes的false。當執行pl/sql查詢時出現溢出錯誤
Error Message:
System.Data.OracleClient.OracleException: OCI-22053: overflow error
at System.Data.Common.DbDataAdapter.FillErrorHandler(Exception e, DataTable dataTable, Object[] dataValues)
at System.Data.Common.DbDataAdapter.FillLoadDataRowChunk(SchemaMapping mapping, Int32 startRecord, Int32 maxRecords)
at System.Data.Common.DbDataAdapter.FillFromReader(Object data, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
下面是代碼:
DataSet ds = new DataSet();
try
{
this.OpenDBConnection();
this.dbAdapter.ReturnProviderSpecificTypes = providerSpecificTypes;
this.dbAdapter.Fill(ds);
}
catch
{
throw;
}
finally
{
CloseDBConnection();
this.cmd.Parameters.Clear();
}
return ds;
查詢:
SELECT client_id, TO_CHAR (business_dt, 'MM/DD/YYYY') AS business_dt
, mkt_type
, mkt_name
, product_name
, period
, TO_CHAR (start_dt, 'MM/DD/YYYY') AS start_dt
, TO_CHAR (end_dt, 'MM/DD/YYYY') AS end_dt
, duration
, term
, NULL AS strike_price
, instrument_type
, final_price
, NULL AS product_price
, units
, NULL AS expiry_dt
, mkt_close
, cons_flag
請添加查詢的其餘部分。列的數據類型也不錯 –
什麼數據庫版本?什麼是數據類型?確保您將Date或DateTime變量傳遞到您的TO_CHAR函數中... – manzwebdesigns
數據庫是Oracle 10g.Yes,正在將DateTime變量傳遞到to_char函數。謝謝。 – user74042