Subject Re: [firebird-support] SQL to find a val in any table
Author Lester Caine
Ann W. Harrison wrote:

>>I need the SQL to find a value in any column in any table. I know that the
>>word "Shigellosis" is in my data somewhere, but I don't know in which table
>>or column.
>
> Sorry, that's not a SQL concept. It is interesting that you ask - a
> group on the architecture list has been arguing recently about cross
> column, cross table searches. Why would anybody want that?

When searching data that has been culled from a range of sources, and
you want to find - say - a town name that could be in one of a number of
columns or note fields.
Part of the 'trick' seems to be to create a calculated field containing
a concatenation of the text in the table, then you only have to search
one field on each table. You then just have to scan each table for the
FULL_SEARCH field.
You need a primary key, but from this search you can build a table of
TABLE_NAME, KEY, FULL_SEARCH. And then you only have to sort through
these results to find the actual record(s) you want.

--
Lester Caine
-----------------------------
L.S.Caine Electronic Services