简体   繁体   English

Oracle NUMBER(20)对应c#类型?

[英]Oracle NUMBER(20) corresponding c# type?

What is the corresponding C# type for an Oracle NUMBER(20)? Oracle NUMBER(20)的相应C#类型是什么? Oracle version is 8. Oracle版本是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 Oracle给我异常:System.Data.Odbc.OdbcException:ERROR [22007] [Microsoft] [Oracle的ODBC驱动程序] [Oracle] ORA-01840:输入值不够长,不适合日期格式

Are you using a GetInt32() method to read the Data? 您是否使用GetInt32()方法来读取数据? Try Using GetDecimal() instead. 请尝试使用GetDecimal()。

Int16 for values between -32768 and 32767, Int32 for values between -2147483648 and 2147483647, and Int64 for anything larger. Int16表示值介于-32768和32767之间,Int32表示值介于-2147483648和2147483647之间,Int64表示更大的值。 refer this 参考这个

the error message ORA-01840: input value not long enough for date format is not a datatype mapping error. 错误消息ORA-01840: input value not long enough for date format不是数据类型映射错误。 This is the kind of error you get when Oracle fails a TO_DATE in some cases such as: 这是Oracle在某些情况下失败TO_DATE时遇到的错误,例如:

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. 我会查看您的SQL查询/ PLSQL块以查找此类错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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