DB2Parameter.Scale Property
Gets or sets the number of decimal places to which Value is resolved.
- Namespace:
IBM.Data.DB2- Assembly:
IBM.Data.DB2(inIBM.Data.DB2.dll)
Syntax
[Visual Basic]
Public Property Scale As Byte Implements IDbDataParameter.Scale
[C#]
public byte Scale {get; set;}
[C++]
public: __property unsigned char get_Scale();
public: __property void set_Scale(unsigned char);
[JScript]
public function get Scale() : Byte;
public function set Scale(Byte);
- Implements:
- IDbDataParameter.Scale
Property value
The number of decimal places to which Value is resolved. The default is 0.
Remarks
The Scale property is used only for decimal and numeric input parameters.
The Scale Property must be explicitly set for decimal data type when binding values for Array data type or for multi-row insert, update, or delete.
Example
[Visual Basic, C#] The following example creates a DB2®Parameter and sets some of its properties.
[Visual Basic]
Public Sub CreateDB2Parameter()
Dim myParameter As New DB2Parameter("Price", DB2Type.Decimal)
myParameter.Value = 3.1416
myParameter.Precision = 8
myParameter.Scale = 4
End Sub 'CreateDB2Parameter
[C#]
public void CreateDB2Parameter()
{
DB2Parameter myParameter = new DB2Parameter("Price", DB2Type.Decimal);
myParameter.Value = 3.1416;
myParameter.Precision = 8;
myParameter.Scale = 4;
}