Hitachi

Hitachi Advanced Database Application Development Guide


15.5.3 Notes about data type conversion

Organization of this subsection

(1) Notes about the BINARY and VARBINARY types

■ Rules for comparing and storing or assigning

■ Rules for retrieval

(2) Notes about the DATE, TIME, and TIMESTAMP types

(3) Notes about the SQL_DECIMAL and SQL_NUMERIC types

In HADB, SQL_DECIMAL and SQL_NUMERIC types are treated identically. Either can be used.

If a fractional value less than 1, whose precision value is equal to its scaling value, is converted to the SQL_DECIMAL or SQL_NUMERIC type, and a zero is entered to the left of the decimal point, an error will occur. This is because the zero is also counted as one digit. You can convert data successfully by specifying the data that begins at the decimal point.

Example:

Retrieving or comparing and assigning a value whose data type defined in the table is DECIMAL(3,3):

  • 0.123: An error occurs.

  • .123: The data is converted successfully.

(4) Notes about the SQL_DOUBLE and SQL_FLOAT types

In HADB, SQL_DOUBLE and SQL_FLOAT types are treated identically. Either can be used.

(5) Notes about the SQL_C_NUMERIC type