- Remove From My Forums
-
Question
-
See the following example of how to insert a valid numeric value (a Decimal) using the System.Data.OracleClient that cannot be retreived using the same System.Data.OracleClient.
It is apparently some sort of bit-wise translation error between the Oracle Client and the Microsoft Data Provider. This test was run with VisualStudio2003 and Oracle 9i Client v9.2.0.4.0 connecting to Oracle Server 9.2.0.4.0, all running on Windows 2000 SP4.
using System;
using System.Data;
using System.Data.OracleClient;namespace OdpTest
{
/// <summary>
/// The following command line application code illustrates haw a value that was inserted
/// using the System.Data.OracleClient causes an overflow error when retreiving it using
/// the same System.Data.OracleClient.
/// </summary>
public class OverflowTest
{
private const string CONNECT_STRING = «USER ID=foo;PASSWORD=bar;DATA SOURCE=foobar»;[STAThread]
private static void Main(string[] args)
{
using (OracleConnection conn = new OracleConnection(CONNECT_STRING))
{
conn.Open();
try
{
using (OracleCommand createCmd = conn.CreateCommand())
{
createCmd.CommandText = «create table overflow_test (num NUMBER)»;
createCmd.ExecuteNonQuery();
}using (OracleCommand insertCmd = conn.CreateCommand())
{
insertCmd.CommandText = «insert into overflow_test (num) values (:a)»;
OracleParameter p = insertCmd.CreateParameter();
p.ParameterName = «a»;
p.Value = 61M / 3M; // The magic value (there are more than just this one)
p.Direction = ParameterDirection.Input;
p.DbType = DbType.Decimal;
insertCmd.Parameters.Add(p);
Console.Error.WriteLine(«Storing value: » + p.Value.ToString());
insertCmd.ExecuteNonQuery();
}using (OracleCommand selectCmd = conn.CreateCommand())
{
selectCmd.CommandText = «select * from overflow_test»;DataTable overflowTest = new DataTable(«overflow_test»);
DataColumn num = new DataColumn(«num», typeof (decimal));
overflowTest.Columns.Add(num);OracleDataAdapter oda = new OracleDataAdapter(selectCmd);
oda.Fill(overflowTest);int i = 0;
foreach (DataRow row in overflowTest.Rows)
{
Console.Error.Write(«Row[{0}]:», i);
for (int j = 0; j < row.Table.Columns.Count; j++)
{
Console.Error.Write(» {0}», row[j]);
}
Console.Error.WriteLine();
}
i++;
}
}
finally
{
using (OracleCommand deleteCmd = conn.CreateCommand())
{
deleteCmd.CommandText = «drop table overflow_test»;
deleteCmd.ExecuteNonQuery();
}
}
}
}
}
}
Answers
-
Dan, your problem is that you’re trying to read the data into a DataSet, which doesn’t support the full precision of the Oracle NUMBER data type, by default.
In ADO.NET 2.0, you can set the ReturnProviderSpecificTypes property of the OracleDataAdapter to true and have it read OracleNumber’s instead of System.Decimal, which can’t handle the value.
When I run pl/sql query[through a stored procedure] using my C# code,I get an error:
How do I resolve the same?Please advise.
Note:am passing false for providerSpecificTypes in the code.
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,
Here is the code:
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;
Query:
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
- Remove From My Forums
-
Question
-
Using oracle stored proc. Gives error on group totals.
Build complete — 0 errors, 0 warnings
[rsErrorReadingDataSetField] The dataset ‘GETARWIPSUMMARYINFO’ contains a definition for the Field ‘JAN_AR_BALANCE’. The data extension returned an error during reading the field. System.Data.OracleClient.OracleException: OCI-22053: overflow errorat System.Data.OracleClient.OracleException.Check(OciErrorHandle errorHandle, Int32 rc)
at System.Data.OracleClient.OracleNumber.ToDecimal(OciErrorHandle errorHandle, Byte[] value)
at System.Data.OracleClient.OracleColumn.GetDecimal(NativeBuffer_RowBuffer buffer)
at System.Data.OracleClient.OracleColumn.GetValue(NativeBuffer_RowBuffer buffer)
at System.Data.OracleClient.OracleDataReader.GetValue(Int32 i)
at Microsoft.ReportingServices.DataExtensions.DataReaderWrapper.GetValue(Int32 fieldIndex)
at Microsoft.ReportingServices.DataExtensions.MappingDataReader.GetFieldValue(Int32 aliasIndex)
[rsErrorReadingDataSetField] The dataset ‘GETARWIPSUMMARYINFO’ contains a definition for the Field ‘JAN_TAX_AMT’. The data extension returned an error during reading the field. System.Data.OracleClient.OracleException: OCI-22053: overflow errorat System.Data.OracleClient.OracleException.Check(OciErrorHandle errorHandle, Int32 rc)
at System.Data.OracleClient.OracleNumber.ToDecimal(OciErrorHandle errorHandle, Byte[] value)
at System.Data.OracleClient.OracleColumn.GetDecimal(NativeBuffer_RowBuffer buffer)
at System.Data.OracleClient.OracleColumn.GetValue(NativeBuffer_RowBuffer buffer)
at System.Data.OracleClient.OracleDataReader.GetValue(Int32 i)
at Microsoft.ReportingServices.DataExtensions.DataReaderWrapper.GetValue(Int32 fieldIndex)
at Microsoft.ReportingServices.DataExtensions.MappingDataReader.GetFieldValue(Int32 aliasIndex)
Preview complete — 0 errors, 2 warnings
Tried changing‘<rd:TypeName>System.Decimal</rd:TypeName>’ to ‘ <rd:TypeName>OracleNumbers</rd:TypeName>’in xml as suggested by someone in a thread. But doesnt seem to work.
Help appreciated!
Answers
-
The error got resolved by rounding the numbers to 22 decimal places . Seems the dot net driver cannot handle precision beyond 22 as compared to OracleNumbers.
-
Marked as answer by
Tuesday, June 16, 2009 3:00 PM
-
Marked as answer by
Содержание
- OGG-00662 OCI Error OCI-22053: Overflow Error (status = 22053). (Doc ID 2504557.1)
- Applies to:
- Symptoms
- Changes
- Cause
- To view full details, sign in with your My Oracle Support account.
- Don’t have a My Oracle Support account? Click to get started!
- Oci 22053 overflow error
- Asked by:
- Question
- Oci 22053 overflow error
- Answered by:
- Question
- Answers
- All replies
- Oci 22053 overflow error
- Answered by:
- Question
- Answers
- Oci 22053 overflow error
- Answered by:
- Question
- Answers
- All replies
OGG-00662 OCI Error OCI-22053: Overflow Error (status = 22053). (Doc ID 2504557.1)
Last updated on NOVEMBER 27, 2019
Applies to:
Symptoms
GoldenGate extract 18.1 will fail and abend during startup:
Source Context :
В SourceModuleВ В В В В В В В В В В : [ggdb.ora.ocicpp.err]
В SourceIDВ В В В В В В В В В В В В В В : [/scratch/aime/adestore/views/aime_adc2280123/oggcore/OpenSys/src/gglib/ggdbora/ocicpp/OCIErrorHandler.cpp]
В SourceMethodВ В В В В В В В В В В : [ociErr]
В SourceLineВ В В В В В В В В В В В В : [91]
В ThreadBacktraceВ В В В В В В В : [19] elements
В В В В В В В В В В В В В В В В В В В В В В В В : [/u01/ogg/qta4801p/libgglog.so(CMessageContext::AddThreadContext())]
В В В В В В В В В В В В В В В В В В В В В В В В : [/u01/ogg/qta4801p/libgglog.so(CMessageFactory::CreateMessage(CSourceContext*, unsigned int, . ))]
В В В В В В В В В В В В В В В В В В В В В В В В : [/u01/ogg/qta4801p/libgglog.so(_MSG_Int32_String(CSourceContext*, int, int, char const*, CMessageFactory::MessageDisposition))]
В В В В В В В В В В В В В В В В В В В В В В В В : [/u01/ogg/qta4801p/extract(ggs::gglib::ggocicpp::OCIErrorHandler::ociErr(int) const)]
В В В В В В В В В В В В В В В В В В В В В В В В : [/u01/ogg/qta4801p/extract(ggs::gglib::ggocicpp::OCIStmtResult::getIntFromNumber(bool, void*, unsigned long) const)]
В В В В В В В В В В В В В В В В В В В В В В В В : [/u01/ogg/qta4801p/extract(ggs::gglib::ggocicpp::OCIStmtResult::getU32() const)]
В В В В В В В В В В В В В В В В В В В В В В В В : [/u01/ogg/qta4801p/extract(DBOCI_get_incarnation_info(ggs::gglib::ggocicpp::ORAConnection&, unsigned int*, unsigned int*, unsigned int*, unsigned int*, char*))]
В В В В В В В В В В В В В В В В В В В В В В В В : [/u01/ogg/qta4801p/extract(RedoClassic::validateConfig(log_context_t*, ggs::gglib::ggocicpp::ORAConnection*, ggs::gglib::ggdatasource::DataSource*, ggs::gglib::ggapp::ReplicationContext*))]
В В В В В В В В В В В В В В В В В В В В В В В В : [/u01/ogg/qta4801p/extract(RedoAPI::createInstance(ggs::gglib::ggdatasource::DataSource*, ggs::gglib::ggapp::ReplicationContext*))]
В В В В В В В В В В В В В В В В В В В В В В В В : [/u01/ogg/qta4801p/extract(ggs::er::OraTranLogDataSource::setup())]
В В В В В В В В В В В В В В В В В В В В В В В В : [/u01/ogg/qta4801p/extract(ggs::gglib::ggapp::ReplicationContext::establishStartPoints(char, ggs::gglib::ggdatasource::DataSourceParams const&))]
В В В В В В В В В В В В В В В В В В В В В В В В : [/u01/ogg/qta4801p/extract(ggs::gglib::ggapp::ReplicationContext::initializeDataSources(ggs::gglib::ggdatasource::DataSourceParams&))]
В В В В В В В В В В В В В В В В В В В В В В В В : [/u01/ogg/qta4801p/extract()]
В В В В В В В В В В В В В В В В В В В В В В В В : [/u01/ogg/qta4801p/extract(ggs::gglib::MultiThreading::MainThread::ExecMain())]
В В В В В В В В В В В В В В В В В В В В В В В В : [/u01/ogg/qta4801p/extract(ggs::gglib::MultiThreading::Thread::RunThread(ggs::gglib::MultiThreading::Thread::ThreadArgs*))]
В В В В В В В В В В В В В В В В В В В В В В В В : [/u01/ogg/qta4801p/extract(ggs::gglib::MultiThreading::MainThread::Run(int, char**))]
В В В В В В В В В В В В В В В В В В В В В В В В : [/u01/ogg/qta4801p/extract(main)]
В В В В В В В В В В В В В В В В В В В В В В В В : [/lib64/libc.so.6(__libc_start_main)]
В В В В В В В В В В В В В В В В В В В В В В В В : [/u01/ogg/qta4801p/extract()]
2019-01-22 06:45:48В ERRORВ В OGG-00662В OCI Error OCI-22053: overflow error
(status = 22053).
2019-01-22 06:45:48В ERRORВ В OGG-01668В PROCESS ABENDING.
Changes
Installed or upgraded GoldenGate to 18.1.
Cause
To view full details, sign in with your My Oracle Support account.
Don’t have a My Oracle Support account? Click to get started!
In this Document
My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.
Oracle offers a comprehensive and fully integrated stack of cloud applications and platform services. For more information about Oracle (NYSE:ORCL), visit oracle.com. пїЅ Oracle | Contact and Chat | Support | Communities | Connect with us | |
|
| Legal Notices | Terms of Use
Источник
Oci 22053 overflow error
Asked by:
Question
User-1344218091 posted
i am retriving the record from oracle database table. but i am getting the error like OCI-22053 overflow error.
How i can overcome it. plz any body can help me.
here is my code:
selectQry= «SELECT NVL(PAYABLE_AMOUNT,0)+NVL(OS_SURCHARGE,0)PAYABLE_AMOUNT,
NVL(SURCHARGE_TO_BE_PAID,0)SURCHARGE_TO_BE_PAID, TO_CHAR(PAY_BY_DATE,’dd-MM-yyyy’)PAY_BY_DATE, NVL(MONTHS_BETWEEN(PAY_BY_DATE,SYSDATE),0)MONTHS_BETWEEN_DATE, BILL_STATUS,ROUND(SYSDATE-(PAY_BY_DATE+6))ROUND_DAYS FROM CANCEL_BILL_DETAILS WHERE BILL_NO=’»+ billNo +»‘»;
m_oConnection1.ConnectionString = «Data Source=»+ this .DsName+»;User #0000ff»>this .UserName + «;Password=»+ this .Passwd;
adapter = new OracleDataAdapter();
adapter.SelectCommand = new OracleCommand(selectQry, this .m_oConnection1);
DataTableMapping tm = adapter.TableMappings.Add(«Table», «ResponseData»);
int recCount=adapter.Fill(oDetails.m_oDataSet); // HereI am getting the OCI-22053 overflow error
throw new Exception(«Insufficient inputs provided- Re-Submit with necessary input»);
Источник
Oci 22053 overflow error
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Answered by:
Question
About the Oracle error » OCI-22053: overflow error » produced by the dataset. Setting the ReturnProviderSpecificTypes property to True or storing in a Decimal (discussed in other threads) aren’t real acceptable solutions. The solution would be for the .NET dataset to provide complete support for the Oracle type.
Has this problem been solved in any of the versions of .NET after 2.0.5 SP2 ?
Is there a solution using a dataset that actually preserves the original numeric value with all its precision, etc, and succeeds w/o throwing an exception?
Or is the only solution to use the Oracle-provided driver?
Thanks in advance,
Answers
Please understand that you cannot resolve the compatibility issue, with respect to precision, between the Oracle Decimal data type and .NET Decimal data type, however; ODP.NET does allow you to convert the value to a string:
Microsoft MVP (Visual Basic)
Microsoft MVP (Visual Basic)
The db programmer defined them as NUMBER no scale or precision.
I have no control over the db people, and if I’d ask to change it, they’d ask why I’m not using a driver that supports that (the Oracle one) from the beginning and make a bunch of noise about that. On top of that I’d have to recode stuff, change the project references, and bugs can be introduced.
What’s the reason why MS driver doesn’t support the Number data type? Is that going to be supported in future releases?
Would you please explain how to handle this?
Thanks in advance,
Microsoft doesn’t typically support all of the features that are specific to a certain database implementation. It was true of their OLEDB Provider and ODBC driver with respect to CLOB and BLOB data types (which were released in later Oracle versions) and it’s also true of the Oracle .NET Provider in this instance.
Источник
Oci 22053 overflow error
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Answered by:
Question
I am SSMA for Oracle to migrate data from Oracle to SQLServer 2012
While Migrating Oracle table with Float(126) datatype, SSMA shows the Target database(SQLServer) datatype conversion as Float(53), since SQLServer will allow maximum of 53 precision under float. Beacuse of this i am getting OCI-22053 OVERFLOW ERROR and table is not migrated fully.
I tried to manually change the SSMA Type mapping but this didnt work. Can anyone please suggest some other method to migrate Oracle float(126) data to SQLServer.
Thanks, Balaji NS
Answers
But ,is there any way out using SSMA itself? I am struct with SSMA as it is the only optioned approved for my migration project.
Agree with Shanky, you should better to use other mechanism for migrating data from Oracle to SQL Server and avoiding the overflow error. If you must use MMSA to move data. I recommend you can use TRUNC function to return a number truncated to a certain number of decimal places in Oracle, then migrate data for resolving the OCI-22053 overflow error. For example, the TRUNC function can be used in Oracle.
Источник
Oci 22053 overflow error
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Answered by:
Question
About the Oracle error » OCI-22053: overflow error » produced by the dataset. Setting the ReturnProviderSpecificTypes property to True or storing in a Decimal (discussed in other threads) aren’t real acceptable solutions. The solution would be for the .NET dataset to provide complete support for the Oracle type.
Has this problem been solved in any of the versions of .NET after 2.0.5 SP2 ?
Is there a solution using a dataset that actually preserves the original numeric value with all its precision, etc, and succeeds w/o throwing an exception?
Or is the only solution to use the Oracle-provided driver?
Thanks in advance,
Answers
Please understand that you cannot resolve the compatibility issue, with respect to precision, between the Oracle Decimal data type and .NET Decimal data type, however; ODP.NET does allow you to convert the value to a string:
Microsoft MVP (Visual Basic)
Microsoft MVP (Visual Basic)
The db programmer defined them as NUMBER no scale or precision.
I have no control over the db people, and if I’d ask to change it, they’d ask why I’m not using a driver that supports that (the Oracle one) from the beginning and make a bunch of noise about that. On top of that I’d have to recode stuff, change the project references, and bugs can be introduced.
What’s the reason why MS driver doesn’t support the Number data type? Is that going to be supported in future releases?
Would you please explain how to handle this?
Thanks in advance,
Microsoft doesn’t typically support all of the features that are specific to a certain database implementation. It was true of their OLEDB Provider and ODBC driver with respect to CLOB and BLOB data types (which were released in later Oracle versions) and it’s also true of the Oracle .NET Provider in this instance.
Источник
Guest
-
#1
I have a query against a database that continues to crash my app with an
Oracle CLient Error OCI-22053 Overflow Error.
The query is:
SELECT pt.adjusted_delivered_qty, pt.expected,
(CASE
WHEN pt.val2> 0
THEN pt.val1 / pt.val2
ELSE 1
END
) AS rate
FROM myTable pt
I can execute the query in Toad For Oracle and get the results as expected.
The results from Toad are listed below.
Why am I getting this error? There should be no overflow.
Thanks,
—
Dale Preston
MCAD C#
MCSE, MCDBA
Results of query in Toad are:
Val1 Val2 Rate
6 25 0.24
137 2800 0.048928571
113475 116000 0.978232759
64 61 1.049180328
1 210 0.004761905
10 10 1
40 40 1
81 82 0.987804878
1 35 0.028571429
77 420 0.183333333
0 1 0
0 5 0
0 22 0
0 22 0
0 1 0
0 1 0
0 28 0
0 28 0
2 5 0.4
80 80 1
22 200 0.11
118 110 1.072727273
122 110 1.109090909
32 190 0.168421053
2 30 0.066666667
26 320 0.08125
2 2 1
10 10 1
2770 2700 1.025925926
6 4 1.5
6 6 1
3 3 1
2 2 1
3285 3400 0.966176471
61 58 1.051724138
88 74 1.189189189
6 6 1
2 350 0.005714286
1 35 0.028571429
24 420 0.057142857
0 1 0
0 5 0
0 22 0
0 22 0
0 1 0
0 1 0
0 28 0
0 28 0
2 5 0.4
82 80 1.025
11 10 1.1
11 10 1.1
1 2 0.5
5 110 0.045454545
2 120 0.016666667
6 6 1
2 2 1
117 110 1.063636364
124 120 1.033333333
6 6 1
46 46 1
128 100 1.28
2 2 1
117 110 1.063636364
141 120 1.175
6 6 1
117 110 1.063636364
117 110 1.063636364
191 175 1.091428571
4 500 0.008
3 5 0.6
130 100 1.3
1 110 0.009090909
2 2 1
117 110 1.063636364
136 120 1.133333333
6 6 1
29 35 0.828571429
352 420 0.838095238
30 25 1.2
122 110 1.109090909
46 46 1
128 100 1.28
1 1 1
1 1 1
2 6 0.333333333
2 2 1
518 350 1.48
522 500 1.044
191 175 1.091428571
2 5 0.4
0 5 0
46 46 1
128 100 1.28
1 1 1
2 1 2
2 2 1
117 110 1.063636364
136 120 1.133333333
6 6 1
118 110 1.072727273
30 35 0.857142857
2757 2700 1.021111111
6 4 1.5
6 6 1
425 420 1.011904762
227 200 1.135
30 25 1.2
114265 116000 0.985043103
122 110 1.109090909
198 190 1.042105263
36 30 1.2
344 320 1.075
2 2 1
0 1 0
0 5 0
0 22 0
0 22 0
2 2 1
3283 2800 1.1725
10 10 1
84 74 1.135135135
6 6 1
67 61 1.098360656
0 1 0
204 210 0.971428571
520 500 1.04
189 175 1.08
567 350 1.62
885 450 1.966666667
62 60 1.033333333
62 60 1.033333333
62 60 1.033333333
62 60 1.033333333
1 2 0.5
3 7 0.428571429
5 7 0.714285714
5 7 0.714285714
5 7 0.714285714
7 7 1
12 120 0.1
46 46 1
12 100 0.12
1 1 1
118 100 1.18
121 110 1.1
118 110 1.072727273
40 40 1
2 2 1
73 70 1.042857143
390 370 1.054054054
147 10 14.7
20 20 1
0 1 0
240 220 1.090909091
8 8 1
17 18 0.944444444
30 30 1
2173 1600 1.358125
299 161 1.857142857
148 10 14.8
83 80 1.0375
83 82 1.012195122
57 56 1.017857143
1544 200 7.72
54 50 1.08
9 8 1.125
9 8 1.125
1067 1000 1.067
8 8 1
7 6 1.166666667
7 7 1
11 10 1.1
2 2 1
2 6 0.333333333
9 9 1
3 3 1
1 1 1
2 2 1
6 6 1
1 1 1
19 19 1
12 10 1.2
10 10 1
15 15 1
1 1 1
58 62 0.935483871
135 100 1.35
646 636 1.01572327
1 1 1
0 50 0
4 2 2
0 175 0
0 4 0
0 59 0
0 2 0
0 10 0
0 326 0
0 33 0
0 2 0
0 5 0
0 10 0
0 6 0
0 6 0
0 10 0
0 5 0
0 9 0
0 9 0
0 200 0
0 3 0
0 900 0
0 24 0
0 500 0
0 10 0
0 10 0
0 1 0
0 28 0
0 28 0
3280 3400 0.964705882
61 58 1.051724138
3 3 1
1 1 1
0 1 0
0 22 0
1 1 1
6 5 1.2
3 3 1
281 204 1.37745098
404 650 0.621538462
52 100 0.52
889 1100 0.808181818
1 1 1
0 100 0
0 138 0
0 10 0
0 5 0
0 24 0
0 10 0
0 170 0
0 200 0
0 10 0
0 15 0
0 3 0
1 1 1
118 110 1.072727273
1 35 0.028571429
10 10 1
22 200 0.11
68 420 0.161904762
6 25 0.24
122 110 1.109090909
32 190 0.168421053
2 30 0.066666667
26 320 0.08125
2 2 1
2773 2700 1.027037037
6 4 1.5
6 6 1
114429 116000 0.986456897
2838 2800 1.013571429
0 1 0
0 5 0
0 22 0
0 22 0
0 1 0
0 1 0
0 28 0
0 28 0
40 40 1
3287 3400 0.966764706
61 58 1.051724138
3 3 1
2 2 1
88 74 1.189189189
6 6 1
Advertisements
Guest
-
#2
Here is my corrected query. I didn’t clean it up properly the first post but
the effect is the same: overflow error from the .Net Oracle client.
Dale
SELECT pt.val1, pt.val2,
(CASE
WHEN pt.val2> 0
THEN pt.val1 / pt.val2
ELSE 1
END
) AS rate
FROM myTable pt
WenYuan Wang [MSFT]
-
#3
Hello Dale,
According to your description, you meet an issue that following select
command will throw an «Oracle Client Error OCI-22053 Overflow Error»
exception by .Net Oracle client. If I misunderstoo, please correct me.
SELECT pt.val1, pt.val2,
(CASE
WHEN pt.val2> 0
THEN pt.val1 / pt.val2
ELSE 1
END
) AS rate
FROM myTable pt
It seems the issue is related to «pt.val1/pt.val2». As far as I know,
System.Data.OracleClient namespace does only support 38 digits.
I suggest you use ORACLE SQL TRUNC(number, decimal_places) function to work
around it.
http://www.techonthenet.com/oracle/functions/trunc_nbr.php
[Oracle/PLSQL: Trunc Function (with numbers)]
SELECT pt.val1, pt.val2,
(CASE
WHEN pt.val2> 0
THEN trunc(pt.val1/pt.val2,6)
ELSE 1
END
) AS rate
FROM myTable pt
Hope this helps. Please try the above method and let me know if this works
on your side. It’s my pleasure to assist you.
Have a great day.
Best regards,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided «AS IS» with no warranties, and confers no rights.
Guest
-
#4
Thanks Wen,
That did solve the problem. I also found another article suggesting
ROUND(val1/val2, 2) which worked as well.
WenYuan Wang [MSFT]
-
#5
Welcome, Dave.
Have a great day,
Best regards,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided «AS IS» with no warranties, and confers no rights.
WenYuan Wang [MSFT]
-
#6
Welcome, Dale.
If you have any further issue, please feel free to update here again. I’m
glad to assist you.
Have a great day,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided «AS IS» with no warranties, and confers no rights.
Advertisements
Quang Vo
-
#8
rounding or truncating should fixes the issue. I find this help http://www.itjungles.com/other/fixed-oci-22053-overflow-error
I have a query against a database that continues to crash my app with an
Oracle CLient Error OCI-22053 Overflow Error.The query is:
SELECT pt.adjusted_delivered_qty, pt.expected,
(CASE
WHEN pt.val2> 0
THEN pt.val1 / pt.val2
ELSE 1
END
) AS rate
FROM myTable ptI can execute the query in Toad For Oracle and get the results as expected.
The results from Toad are listed below.Why am I getting this error? There should be no overflow.
Thanks,
—
Dale Preston
MCAD C#
MCSE, MCDBAResults of query in Toad are:
Val1 Val2 Rate
6 25 0.24
137 2800 0.048928571
113475 116000 0.978232759
64 61 1.049180328
1 210 0.004761905
10 10 1
40 40 1
81 82 0.987804878
1 35 0.028571429
77 420 0.183333333
0 1 0
0 5 0
0 22 0
0 22 0
0 1 0
0 1 0
0 28 0
0 28 0
2 5 0.4
80 80 1
22 200 0.11
118 110 1.072727273
122 110 1.109090909
32 190 0.168421053
2 30 0.066666667
26 320 0.08125
2 2 1
10 10 1
2770 2700 1.025925926
6 4 1.5
6 6 1
3 3 1
2 2 1
3285 3400 0.966176471
61 58 1.051724138
88 74 1.189189189
6 6 1
2 350 0.005714286
1 35 0.028571429
24 420 0.057142857
0 1 0
0 5 0
0 22 0
0 22 0
0 1 0
0 1 0
0 28 0
0 28 0
2 5 0.4
82 80 1.025
11 10 1.1
11 10 1.1
1 2 0.5
5 110 0.045454545
2 120 0.016666667
6 6 1
2 2 1
117 110 1.063636364
124 120 1.033333333
6 6 1
46 46 1
128 100 1.28
2 2 1
117 110 1.063636364
141 120 1.175
6 6 1
117 110 1.063636364
117 110 1.063636364
191 175 1.091428571
4 500 0.008
3 5 0.6
130 100 1.3
1 110 0.009090909
2 2 1
117 110 1.063636364
136 120 1.133333333
6 6 1
29 35 0.828571429
352 420 0.838095238
30 25 1.2
122 110 1.109090909
46 46 1
128 100 1.28
1 1 1
1 1 1
2 6 0.333333333
2 2 1
518 350 1.48
522 500 1.044
191 175 1.091428571
2 5 0.4
0 5 0
46 46 1
128 100 1.28
1 1 1
2 1 2
2 2 1
117 110 1.063636364
136 120 1.133333333
6 6 1
118 110 1.072727273
30 35 0.857142857
2757 2700 1.021111111
6 4 1.5
6 6 1
425 420 1.011904762
227 200 1.135
30 25 1.2
114265 116000 0.985043103
122 110 1.109090909
198 190 1.042105263
36 30 1.2
344 320 1.075
2 2 1
0 1 0
0 5 0
0 22 0
0 22 0
2 2 1
3283 2800 1.1725
10 10 1
84 74 1.135135135
6 6 1
67 61 1.098360656
0 1 0
204 210 0.971428571
520 500 1.04
189 175 1.08
567 350 1.62
885 450 1.966666667
62 60 1.033333333
62 60 1.033333333
62 60 1.033333333
62 60 1.033333333
1 2 0.5
3 7 0.428571429
5 7 0.714285714
5 7 0.714285714
5 7 0.714285714
7 7 1
12 120 0.1
46 46 1
12 100 0.12
1 1 1
118 100 1.18
121 110 1.1
118 110 1.072727273
40 40 1
2 2 1
73 70 1.042857143
390 370 1.054054054
147 10 14.7
20 20 1
0 1 0
240 220 1.090909091
8 8 1
17 18 0.944444444
30 30 1
2173 1600 1.358125
299 161 1.857142857
148 10 14.8
83 80 1.0375
83 82 1.012195122
57 56 1.017857143
1544 200 7.72
54 50 1.08
9 8 1.125
9 8 1.125
1067 1000 1.067
8 8 1
7 6 1.166666667
7 7 1
11 10 1.1
2 2 1
2 6 0.333333333
9 9 1
3 3 1
1 1 1
2 2 1
6 6 1
1 1 1
19 19 1
12 10 1.2
10 10 1
15 15 1
1 1 1
58 62 0.935483871
135 100 1.35
646 636 1.01572327
1 1 1
0 50 0
4 2 2
0 175 0
0 4 0
0 59 0
0 2 0
0 10 0
0 326 0
0 33 0
0 2 0
0 5 0
0 10 0
0 6 0
0 6 0
0 10 0
0 5 0
0 9 0
0 9 0
0 200 0
0 3 0
0 900 0
0 24 0
0 500 0
0 10 0
0 10 0
0 1 0
0 28 0
0 28 0
3280 3400 0.964705882
61 58 1.051724138
3 3 1
1 1 1
0 1 0
0 22 0
1 1 1
6 5 1.2
3 3 1
281 204 1.37745098
404 650 0.621538462
52 100 0.52
889 1100 0.808181818
1 1 1
0 100 0
0 138 0
0 10 0
0 5 0
0 24 0
0 10 0
0 170 0
0 200 0
0 10 0
0 15 0
0 3 0
1 1 1
118 110 1.072727273
1 35 0.028571429
10 10 1
22 200 0.11
68 420 0.161904762
6 25 0.24
122 110 1.109090909
32 190 0.168421053
2 30 0.066666667
26 320 0.08125
2 2 1
2773 2700 1.027037037
6 4 1.5
6 6 1
114429 116000 0.986456897
2838 2800 1.013571429
0 1 0
0 5 0
0 22 0
0 22 0
0 1 0
0 1 0
0 28 0
0 28 0
40 40 1
3287 3400 0.966764706
61 58 1.051724138
3 3 1
2 2 1
88 74 1.189189189
6 6 1On Wednesday, August 29, 2007 4:32 PM dale097 wrote:
Here is my corrected query. I didn’t clean it up properly the first post but
the effect is the same: overflow error from the .Net Oracle client.Dale
SELECT pt.val1, pt.val2,
(CASE
WHEN pt.val2> 0
THEN pt.val1 / pt.val2
ELSE 1
END
) AS rate
FROM myTable ptOn Thursday, August 30, 2007 7:46 AM v-wywan wrote:
Hello Dale,According to your description, you meet an issue that following select
command will throw an «Oracle Client Error OCI-22053 Overflow Error»
exception by .Net Oracle client. If I misunderstoo, please correct me.
SELECT pt.val1, pt.val2,
(CASE
WHEN pt.val2> 0
THEN pt.val1 / pt.val2
ELSE 1
END
) AS rate
FROM myTable ptIt seems the issue is related to «pt.val1/pt.val2». As far as I know,
System.Data.OracleClient namespace does only support 38 digits.I suggest you use ORACLE SQL TRUNC(number, decimal_places) function to work
around it.
http://www.techonthenet.com/oracle/functions/trunc_nbr.php
[Oracle/PLSQL: Trunc Function (with numbers)]SELECT pt.val1, pt.val2,
(CASE
WHEN pt.val2> 0
THEN trunc(pt.val1/pt.val2,6)
ELSE 1
END
) AS rate
FROM myTable ptHope this helps. Please try the above method and let me know if this works
on your side. It’s my pleasure to assist you.
Have a great day.
Best regards,Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided «AS IS» with no warranties, and confers no rights.On Thursday, August 30, 2007 10:18 AM dale097 wrote:
Thanks Wen,That did solve the problem. I also found another article suggesting
ROUND(val1/val2, 2) which worked as well.
—
Dale Preston
MCAD C#
MCSE, MCDBA«WenYuan Wang [MSFT]» wrote:
Advertisements
Quang Vo
-
#9
I find that to fix this issue we just have to round or truncate value where decimal is greater then what the current dataset can suppport. here’s how: http://www.itjungles.com/other/fixed-oci-22053-overflow-error
I have a query against a database that continues to crash my app with an
Oracle CLient Error OCI-22053 Overflow Error.The query is:
SELECT pt.adjusted_delivered_qty, pt.expected,
(CASE
WHEN pt.val2> 0
THEN pt.val1 / pt.val2
ELSE 1
END
) AS rate
FROM myTable ptI can execute the query in Toad For Oracle and get the results as expected.
The results from Toad are listed below.Why am I getting this error? There should be no overflow.
Thanks,
—
Dale Preston
MCAD C#
MCSE, MCDBAResults of query in Toad are:
Val1 Val2 Rate
6 25 0.24
137 2800 0.048928571
113475 116000 0.978232759
64 61 1.049180328
1 210 0.004761905
10 10 1
40 40 1
81 82 0.987804878
1 35 0.028571429
77 420 0.183333333
0 1 0
0 5 0
0 22 0
0 22 0
0 1 0
0 1 0
0 28 0
0 28 0
2 5 0.4
80 80 1
22 200 0.11
118 110 1.072727273
122 110 1.109090909
32 190 0.168421053
2 30 0.066666667
26 320 0.08125
2 2 1
10 10 1
2770 2700 1.025925926
6 4 1.5
6 6 1
3 3 1
2 2 1
3285 3400 0.966176471
61 58 1.051724138
88 74 1.189189189
6 6 1
2 350 0.005714286
1 35 0.028571429
24 420 0.057142857
0 1 0
0 5 0
0 22 0
0 22 0
0 1 0
0 1 0
0 28 0
0 28 0
2 5 0.4
82 80 1.025
11 10 1.1
11 10 1.1
1 2 0.5
5 110 0.045454545
2 120 0.016666667
6 6 1
2 2 1
117 110 1.063636364
124 120 1.033333333
6 6 1
46 46 1
128 100 1.28
2 2 1
117 110 1.063636364
141 120 1.175
6 6 1
117 110 1.063636364
117 110 1.063636364
191 175 1.091428571
4 500 0.008
3 5 0.6
130 100 1.3
1 110 0.009090909
2 2 1
117 110 1.063636364
136 120 1.133333333
6 6 1
29 35 0.828571429
352 420 0.838095238
30 25 1.2
122 110 1.109090909
46 46 1
128 100 1.28
1 1 1
1 1 1
2 6 0.333333333
2 2 1
518 350 1.48
522 500 1.044
191 175 1.091428571
2 5 0.4
0 5 0
46 46 1
128 100 1.28
1 1 1
2 1 2
2 2 1
117 110 1.063636364
136 120 1.133333333
6 6 1
118 110 1.072727273
30 35 0.857142857
2757 2700 1.021111111
6 4 1.5
6 6 1
425 420 1.011904762
227 200 1.135
30 25 1.2
114265 116000 0.985043103
122 110 1.109090909
198 190 1.042105263
36 30 1.2
344 320 1.075
2 2 1
0 1 0
0 5 0
0 22 0
0 22 0
2 2 1
3283 2800 1.1725
10 10 1
84 74 1.135135135
6 6 1
67 61 1.098360656
0 1 0
204 210 0.971428571
520 500 1.04
189 175 1.08
567 350 1.62
885 450 1.966666667
62 60 1.033333333
62 60 1.033333333
62 60 1.033333333
62 60 1.033333333
1 2 0.5
3 7 0.428571429
5 7 0.714285714
5 7 0.714285714
5 7 0.714285714
7 7 1
12 120 0.1
46 46 1
12 100 0.12
1 1 1
118 100 1.18
121 110 1.1
118 110 1.072727273
40 40 1
2 2 1
73 70 1.042857143
390 370 1.054054054
147 10 14.7
20 20 1
0 1 0
240 220 1.090909091
8 8 1
17 18 0.944444444
30 30 1
2173 1600 1.358125
299 161 1.857142857
148 10 14.8
83 80 1.0375
83 82 1.012195122
57 56 1.017857143
1544 200 7.72
54 50 1.08
9 8 1.125
9 8 1.125
1067 1000 1.067
8 8 1
7 6 1.166666667
7 7 1
11 10 1.1
2 2 1
2 6 0.333333333
9 9 1
3 3 1
1 1 1
2 2 1
6 6 1
1 1 1
19 19 1
12 10 1.2
10 10 1
15 15 1
1 1 1
58 62 0.935483871
135 100 1.35
646 636 1.01572327
1 1 1
0 50 0
4 2 2
0 175 0
0 4 0
0 59 0
0 2 0
0 10 0
0 326 0
0 33 0
0 2 0
0 5 0
0 10 0
0 6 0
0 6 0
0 10 0
0 5 0
0 9 0
0 9 0
0 200 0
0 3 0
0 900 0
0 24 0
0 500 0
0 10 0
0 10 0
0 1 0
0 28 0
0 28 0
3280 3400 0.964705882
61 58 1.051724138
3 3 1
1 1 1
0 1 0
0 22 0
1 1 1
6 5 1.2
3 3 1
281 204 1.37745098
404 650 0.621538462
52 100 0.52
889 1100 0.808181818
1 1 1
0 100 0
0 138 0
0 10 0
0 5 0
0 24 0
0 10 0
0 170 0
0 200 0
0 10 0
0 15 0
0 3 0
1 1 1
118 110 1.072727273
1 35 0.028571429
10 10 1
22 200 0.11
68 420 0.161904762
6 25 0.24
122 110 1.109090909
32 190 0.168421053
2 30 0.066666667
26 320 0.08125
2 2 1
2773 2700 1.027037037
6 4 1.5
6 6 1
114429 116000 0.986456897
2838 2800 1.013571429
0 1 0
0 5 0
0 22 0
0 22 0
0 1 0
0 1 0
0 28 0
0 28 0
40 40 1
3287 3400 0.966764706
61 58 1.051724138
3 3 1
2 2 1
88 74 1.189189189
6 6 1On Wednesday, August 29, 2007 4:32 PM dale097 wrote:
Here is my corrected query. I didn’t clean it up properly the first post but
the effect is the same: overflow error from the .Net Oracle client.Dale
SELECT pt.val1, pt.val2,
(CASE
WHEN pt.val2> 0
THEN pt.val1 / pt.val2
ELSE 1
END
) AS rate
FROM myTable ptOn Thursday, August 30, 2007 7:46 AM v-wywan wrote:
Hello Dale,According to your description, you meet an issue that following select
command will throw an «Oracle Client Error OCI-22053 Overflow Error»
exception by .Net Oracle client. If I misunderstoo, please correct me.
SELECT pt.val1, pt.val2,
(CASE
WHEN pt.val2> 0
THEN pt.val1 / pt.val2
ELSE 1
END
) AS rate
FROM myTable ptIt seems the issue is related to «pt.val1/pt.val2». As far as I know,
System.Data.OracleClient namespace does only support 38 digits.I suggest you use ORACLE SQL TRUNC(number, decimal_places) function to work
around it.
http://www.techonthenet.com/oracle/functions/trunc_nbr.php
[Oracle/PLSQL: Trunc Function (with numbers)]SELECT pt.val1, pt.val2,
(CASE
WHEN pt.val2> 0
THEN trunc(pt.val1/pt.val2,6)
ELSE 1
END
) AS rate
FROM myTable ptHope this helps. Please try the above method and let me know if this works
on your side. It’s my pleasure to assist you.
Have a great day.
Best regards,Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided «AS IS» with no warranties, and confers no rights.On Thursday, August 30, 2007 10:18 AM dale097 wrote:
Thanks Wen,That did solve the problem. I also found another article suggesting
ROUND(val1/val2, 2) which worked as well.
—
Dale Preston
MCAD C#
MCSE, MCDBA«WenYuan Wang [MSFT]» wrote:
Perhaps that question is closed, because it is «mainly based on opinions», but, I think it is possible to answer it objectively.C, C++, C#? Why should a beginner start learning?Sure. https://pt.wikipedia.org/wiki/C_Sharp It’s the easiest of the three. [1]C# has a «more intuitive and less exotic» syntax (opinion), compared to https://pt.wikipedia.org/wiki/C_(linguagem_de_programa%C3%A7%C3%A3o) and https://pt.wikipedia.org/wiki/C%2B%2B , some people even consider C and C++ as languages average level, since it is possible to write excerpts using the language https://pt.stackoverflow.com/q/178804/86952 in them, which is low level. The level of abstraction in C# on the other hand is higher, if we take into account, for example, what programs in C and C++ are compiled for machine language and C# is compiled for intermediate language ( https://pt.wikipedia.org/wiki/Common_Intermediate_Language ), which is then translated into native code or executed by a virtual machine ( https://stackoverflow.com/a/8837367/8133067 ).C# simplifies many tasks, such as memory management with Tractor de Lixo (Garbage Collector), which makes everything much simpler. In C and C++, one of the reasons for your power is that you control everything, including memory allocation and release, which, for example, can greatly increase the performance of an application, but also has a price, because programming gets more complex and it is easier to commit failures that end up with memory leakage and such problems.Following the creation dates of languages, and giving some examples of added abstraction levels from one to another, the list would be in this order:C — >Created in 1972 by Dennis Ritchie at AT&T Bell Labs for developing the Unix operating system (originally written in Assembly).» https://pt.wikipedia.org/wiki/C_(linguagem_de_programa%C3%A7%C3%A3o) )C++ — >Bjarne Stroustrup developed C++ in 1983 Bell Labs as an additional to the C language.» https://pt.wikipedia.org/wiki/C%2B%2B ) — > Abstraction in relation to Introduces Object-Oriented Programming.C# — >During the development of the .NET platform, libraries were originally written in a language called Simple Managed C (SMC), which had its own compiler. But in January 1999, a development team was formed by Anders Hejlsberg, who was chosen by Microsoft to develop the language. It begins the creation of the language called Cool. A little later, in 2000, the .NET project was presented to the public at the Professional Developers Conference (PDC), and the Cool language was renamed and presented as C#.» https://pt.wikipedia.org/wiki/C_Sharp#Hist%C3%B3ria ) -> Abstraction in relation to C++: Introduces Trash Collector, compilation for intermediate language, etc.I am learning Java when I feel I already master the language plan to migrate to .NETIf you are learning Java, one more reason to start with C#, since the two languages have many similarities. Actually, C# was kind of like Microsoft’s response to Java, see this article: https://www.forbes.com/sites/quora/2018/03/02/why-did-microsoft-create-c/ https://www.quora.com/Why-did-Microsoft-create-C-Wasnt-Java-good-enough-in-the-1990s/answer/Dan-Shappir-1 by Dan Shappir (Wix cross), in Quora:During the 1990s, with Bill Gates in charge, and before Ballmer ruined everything, Microsoft was at the top of the Windows monopoly. It was alleged by the U.S. Department of Defense that a Microsoft strategy at the time was «to embrace, extend and extinguish», meaning that they would embrace a successful technology, combine with Windows and extend so that it would become better, but also incompatible with the original. This would lead customers to use Windows and Microsoft products.When Sun launched Java in 1995, Microsoft realized the potential of language and ecosystem and tried to implement this strategy. It introduced its own JVM implementation with the IE3 and then began to enhance it beyond the Java standard. Sun sued Microsoft in October 1997 for incompletely implementing the Java 1.1 standard, which forced Microsoft to discontinue its implementation.Instead of migrating to Sun’s JVM and thus giving Sun a significant leverage in the Windows world, Microsoft decided to «go out of Sun» by Sun, introducing its own programming and platform language and effectively killing Java on Windows. They brought the renowned designer of programming languages Anders Hejlsberg aboard, who had already experience changing and improving existing programming languages, and gave him the task of creating a “better window” (not officially, but in practice). Thus, the C# and the .NET Framework were born.More information on the subject: https://pt.stackoverflow.com/q/19073/86952 https://pt.stackoverflow.com/q/98658/86952 https://pt.stackoverflow.com/q/7740/86952 https://pt.stackoverflow.com/q/110142/86952 https://pt.stackoverflow.com/q/169269/86952 https://pt.stackoverflow.com/q/309322/86952 https://en.m.wikipedia.org/wiki/List_of_C-family_programming_languages [1] Philip put a good point of view in his https://pt.stackoverflow.com/q/344020/#comment692842_344038 :It’s just an opinion, as you said yourself is a post that goes from opinion to answer, I agree that the C# is the easiest language, in terms cited by you, but if the person doesn’t know anything about programming, the Object-oriented paradigm is more complex to learn for a beginner, sometimes it’s better to learn a little C to understand concepts and then go to C#, because if the person doesn’t use a ParadigmaBut in the context of the question, in which the author is already learning Java (which is very similar to C# and also has a paradigm of https://pt.stackoverflow.com/q/88546/86952 ), and then intend to migrate to .NET, I think C# is the obvious choice. Even because I do not believe that there is today some form of integration between the language C and the .NET: https://www.quora.com/How-many-languages-does-NET-framework-support .Other questions related to POO: https://pt.stackoverflow.com/q/13372/86952 https://pt.stackoverflow.com/q/215679/86952 https://pt.stackoverflow.com/q/213951/86952