Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ODP.NET Drops Trailing Zero From Large Number Column (Really!!!)

409750Jul 7 2005 — edited Jul 19 2005
I have a table with a large number column :

GENERATIONNO NOT NULL NUMBER(38)

This column is populated with 29 digit numbers.

When I fill a dataset, from this table, any GENERATIONNO numbers with a SINGLE trailing zero, LOSE the trailing zero!!! Any GENERATIONNO numbers with two trailing zeros are fine - why?

If I TO_CHAR(GENERATIONNO), it is fine (but then the column is a string rather than decimal).

Code :

OracleConnection connection = new OracleConnection(MssAccess.ConnectionString(Database,Username,Password));
OracleCommand command = new OracleCommand();

DataTable results = new DataTable();

connection.Open();
command.Connection = connection;
OracleDataAdapter adapter = new OracleDataAdapter(command);
command.CommandText = "SELECT GENERATIONNO FROM NXENDETAIL WHERE IEKEY=7516022";
command.CommandType = CommandType.Text;

adapter.Fill(results);

Doing a debug quickwatch from VisualStudio on the results DataTable GENERATIONNO column = "2005010200022005010201349999".

From SQLPlus :

SQL> set numwidth 30
SQL> select generationno from nxenselect where iekey=7516022

GENERATIONNO
------------------------------
20050102000220050102013499990

I have tried this with the latest ODP.NET and I get the same problem, (plus the null column reference exceptions someone else has posted).

Please help!

Thanks,

Keith

ODP.NET v10.1.0.301. WindowsXP SP2. Visual Studio.Net 2003

Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit Production
PL/SQL Release 9.2.0.1.0 - Production
CORE 9.2.0.1.0 Production
TNS for Solaris: Version 9.2.0.1.0 - Production
NLSRTL Version 9.2.0.1.0 - Production
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 16 2005
Added on Jul 7 2005
5 comments
479 views