DB2 V9.7 for Linux, UNIX, and Windows

DB2Decimal 结构

表示 DECIMAL DB2 数据类型。如果最大精度为 29 位,那么包括 DECIMAL .NET 数据类型;如果最大精度为 31 位,那么包括 String 数据类型。

名称空间:
IBM.Data.DB2Types
组合件:
IBM.Data.DB2(在 IBM.Data.DB2.dll 中)

语法

[Visual Basic]
Public Structure DB2Decimal
[C#]
public struct DB2Decimal
[C++]
public value class DB2Decimal

示例

[C#] 以下示例演示如何从表中检索单个 DECIMAL 列值。

[C#]
  public static string getParam(DB2Connection conn)
  {
    string mySelectQuery = "SELECT * FROM EMPLOYEE";
    DB2Command myCommand = new DB2Command(mySelectQuery, conn);
    DB2DataReader reader = myCommand.ExecuteReader();

    if (reader.Read())
      {
                DB2Decimal selectValue = reader.GetDB2Decimal(11);

      if (!selectValue.IsNull) { return selectValue.ToString(); }
    }

    return "NULL";
  }

线程安全

此类型的任何公用静态(Visual Basic 中的 Shared)成员对于多线程操作都是安全的。 不保证任何实例成员均为线程安全。

版本信息

最近一次更新
本主题在 IBM DB2 V9.5 中进行了最近一次更新
.NET Framework 版本
支持版本:2.0、3.0、3.5 和 4.0
IBM 数据服务器客户机
支持版本:IBM DB2 V9