M204.2451

From m204wiki
Jump to navigation Jump to search

M204.2451  Bad mapping of SQL column token.token2 to M204 field token3 (datatype mismatch)

An SQL column is mapped to an indexed Model 204 field, but its SQL datatype is not consistent with the Model 204 datatype of the field. If such a column is used in a retrieval condition of an SQL request, the whole file resource is locked at evaluation time, and Table B is searched instead of indexed. If the file is large, substantial performance degradation results.

This message might be produced during SQL query compilation in the following cases:

  • Field is ORDERED CHARACTER, but SQL column type is not CHARACTER.
  • Field is ORDERED NUMERIC, but SQL column type is CHARACTER.
  • Field is KEY STRING, but SQL column type is not CHARACTER.
  • Field is KEY or HASH, its datatype is BINARY or FLOAT, but SQL column type is CHARACTER.
  • Field is KEY or HASH, its datatype is STRING, but SQL column type is not CHARACTER.

Response: Avoid using such columns anywhere in query specifications except select column lists.

System manager response: If possible, alter or recreate the table to change the column datatype, so that there are no datatype mismatches.

Message attributes:

RETCODEO=0Sets online return code
RETCODEB=0Sets batch (single user) return code
CLASS=IInformation class; the message can be suppressed with the X'02' bit setting of the MSGCTL parameter
AUDITADWrites the message with line type AD to the audit trail
NOCOUNTDoes not increment the error count (ERCNT) parameter

Back to list of messages