简体   繁体   中英

Oracle NUMBER(20) corresponding c# type?

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.OdbcException: ERROR [22007] [Microsoft][ODBC driver for Oracle][Oracle]ORA-01840: input value not long enough for date format

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM