C
Chris M
Hi group,
Wonder if anyone has ever come across this:
I have a table with a few thousand records. One column/field of this table
is a 'Batch Id'. This is a non-unique identifier (ie there can be more than
one record in the table with the same BatchId).
The format of this is 3 letters then a slash then 3 or 4 digits, eg:
BAI/1234, BAI/776, XYZ/9999
I have a query which is basically:
SELECT * FROM MyTable
WHERE BatchId LIKE "BAI/????"
Up until today, this has worked fine, and returned the correct number of
rows. All of a sudden it has started returning 0 rows.
My investigations so far show that
There are 2501(interesting number) records that start 'BAI'. The query works
fine if I delete one 'BAI' row, and starts failing again when I put one
back.
There are other prefixes that still work that have many more records, but
'BAI' is the only one that has a mix of 3 and 4 digits in the suffix, all
the rest only have 4.
I think I can get round the problem by making all BAI codes up to four
digits (ie BAI/123 -> BAI/0123). But that will be a massive PITA as these
codes are referenced all over the place.
Anyone any idea what is going on here? More to the point, anyone got any
idea how to fix it (apart from the above solution).
Many thanks,
Chris.
Wonder if anyone has ever come across this:
I have a table with a few thousand records. One column/field of this table
is a 'Batch Id'. This is a non-unique identifier (ie there can be more than
one record in the table with the same BatchId).
The format of this is 3 letters then a slash then 3 or 4 digits, eg:
BAI/1234, BAI/776, XYZ/9999
I have a query which is basically:
SELECT * FROM MyTable
WHERE BatchId LIKE "BAI/????"
Up until today, this has worked fine, and returned the correct number of
rows. All of a sudden it has started returning 0 rows.
My investigations so far show that
There are 2501(interesting number) records that start 'BAI'. The query works
fine if I delete one 'BAI' row, and starts failing again when I put one
back.
There are other prefixes that still work that have many more records, but
'BAI' is the only one that has a mix of 3 and 4 digits in the suffix, all
the rest only have 4.
I think I can get round the problem by making all BAI codes up to four
digits (ie BAI/123 -> BAI/0123). But that will be a massive PITA as these
codes are referenced all over the place.
Anyone any idea what is going on here? More to the point, anyone got any
idea how to fix it (apart from the above solution).
Many thanks,
Chris.