What is the corresponding C# type for an Oracle NUMBER(20)? Oracle version is 8.
Update:
This is insert query. Then try adding the following parameter to command:
IDbDataParameter idParameter = cmd.CreateParameter();
idParameter.DbType = DbType.Int64;
idParameter.Value = id;
cmd.Parameters.Add(idParameter);
Oracle gives me exception: System.Data.Odbc.开发者_Go百科OdbcException: ERROR [22007] [Microsoft][ODBC driver for Oracle][Oracle]ORA-01840: input value not long enough for date format
decimal
http://msdn.microsoft.com/en-us/library/yk72thhd.aspx
the error message ORA-01840: input value not long enough for date format
is not a datatype mapping error. This is the kind of error you get when Oracle fails a TO_DATE
in some cases such as:
SQL> SELECT to_date('0101', 'ddmmyyyy') FROM dual;
ORA-01840: input value not long enough for date format
I would look into your SQL query / PLSQL block for such an error.
Are you using a GetInt32() method to read the Data? Try Using GetDecimal() instead.
Int16 for values between -32768 and 32767, Int32 for values between -2147483648 and 2147483647, and Int64 for anything larger. refer this
精彩评论