Skip to content

Oracle typeof for Number(9,2)

A Repasky

Asked Feb 20, 2013, 11:30 AM EST1 answer
Share
LinkedInX
I am trying to do the same thing for Oracle DataReader that I did for SQL DataReader.

if (dr.GetValue(fcnt).GetType() == typeof(decimal))

sb.Append((

This does not work in Oracle when the column is Number (9,2). 

This is part of a loop where I read a datareader in and create a csv file.  Work great with SQL.

Any help will be greatly appreciated.

Thanks,

arep 

double)(dr.GetDecimal(fcnt)));

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    I do not know why the original post put part of the code at the end.  But I have been experimenting and found out the Oracle treats this as a double.  So here is the code and I hope it does not split it up again.

    if (dr.GetValue(fcnt).GetType() == typeof(double))
                         sb.Append(dr.GetDouble(fcnt));
    0