Input code handling

This brings in two changes related to how we process the input codes:

* validate the input code a minimum, to avoid future issues
* use the GLOB operator instead of the LIKE operator, which removes the need to transform the `*` wildcard into the `%` one.