- Categories:
INVALID_ UK_ POSTAL_ CODE_ COUNT (system data metric function)¶
Returns the count of non-NULL column values that are not a UK postcode in the outward and inward form.
This topic provides the syntax for calling the function directly. To learn how to associate the function with a table or view so it runs at regular intervals, see Associate a DMF.
Syntax¶
Arguments¶
querySpecifies a SQL query that projects a single column.
Allowed data types¶
The column projected by the query must have the VARCHAR data type.
Returns¶
The function returns a NUMBER value. NULL values are not counted.
Usage notes¶
- The value must be an outward code (
A9,A99,AA9,AA99,A9A, orAA9A), an optional single space, and an inward code (a digit and two letters). - The first letter cannot be Q, V, or X, and the second letter cannot be I, J, or Z. The third letter of an
A9Aoutward code is one of A to H, J, K, P, S, T, U, or W. The fourth letter of anAA9Aoutward code is one of A, B, E, H, M, N, P, R, V, W, X, or Y. The two letters of the inward code cannot be C, I, K, M, O, or V. - The special postcodes
GIR 0AAandXM4 5HQare valid. - Letters are matched case-insensitively.
- The whole value must match. A value with leading or trailing whitespace, or with separators other than the ones described here, is counted.
- The function checks the format only; it does not verify that the postcode is assigned.
Example¶
Measure the number of invalid UK postcodes in the postcode column: