How can the host variable type in WHERE clauses affect performance?

One potential source of performance degradation on the IBM® i operating system is the client's use in a C program of a floating-point variable for a comparison in the WHERE clause of a SELECT statement.

If the operating system has to do a conversion of the data for that column, that will prevent it from being able to use an index on that column. You should always try to use the same type for columns, literals, and host variables used in a comparison. If the column in the database is defined as packed or zoned decimal, and the host variable is of some other type, that can present a problem in C.