表示 DECIMAL DB2 数据类型。如果最大精度为 29 位,那么包括 DECIMAL .NET 数据类型;如果最大精度为 31 位,那么包括 String 数据类型。
[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)成员对于多线程操作都是安全的。 不保证任何实例成员均为线程安全。