Set data types for a parameter

Your application should set the type for a parameter as the HCL OneDB™ type whenever possible (using the IfxType argument of IfxParameter constructor).

IfxType enumeration shows the IfxType enumeration.

You can specify a parameter type as a .NET Core DbType instead, and the HCL® OneDB .NET Core Provider will infer the HCL OneDB type as best it can. The .NET Core DbType specifies the data type of a Parameter object of a .NET Core data provider. Some DbType types, such as GUID, do not map to any HCL OneDB type, and an error will be returned. Some DbType types, such as AnsiString, can map to several HCL OneDB types, such as VARCHAR, TEXT, or BLOB; you must be aware that the HCL OneDB .NET Core Provider may not choose the data type you intend.

If you do not specify either the HCL OneDB data type or a ..NET Core DbType, the HCL OneDB .NET Core Provider attempts to infer the HCL OneDB data type from the value itself. For example, if the value is 4, the provider maps this to an INTEGER data type. Relying on these inferred mappings can lead to unexpected results.