简体   繁体   中英

System.Dbtype for a DB2 Timestamp value

I have an internal library which has an API to call DB2 Stored Procs. As part of the parameter binding, the syntax is:

SPParameter(string paramName, DbType dbType, object paramValue)

One of the input params of the Stored Proc is of the type Timestamp. I am unable to find a System.DbType enum which will work in this case. The possible enums and the error i get are:

  1. Date: Error in DB Write: ERROR [42884] [IBM][DB2/LINUXX8664] SQL0440N
  2. DateTime: Error in DB Write: ERROR [42884] [IBM][DB2/LINUXX8664] SQL0440N
  3. DateTime2: Error in DB Write: No mapping exists from DbType DateTime2 to a known DB2Type.
  4. Time: Error in DB Write: ERROR [42884] [IBM][DB2/LINUXX8664] SQL0440N

Any suggestions on which enum to use?any other approach?

SQL0440N表示您尝试调用的过程不存在,因此我怀疑四分之三的错误不在您使用的数据类型中。

I found the issue was in the order of Params i was entering. Even though I name the Params, it is required for them to be in order in which they are defined in the Stored Proc. Correcting the order solved the issue

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