Subject Re: [firebird-support] Metadata SQL question
Author Lester Caine
Lee Jenkins wrote:

> This question is in relation to my previous question about "Synchronizing
> Generators". Now, that I know that I must not UNDER ANY CIRCUMSTANCES fool
> with my generators, I need to be able to populate my IBOQuery from a table
> but leave out fields that are are involved in an Index that must be unique
> so that they are not included in an Import.
>
> I'm guessing a query that pulls the fields from the table I want, but filter
> out fields that are involved in a unique index? In otherwords, I don't want
> to have to hard code and change the sql whenever I add another table and/or
> unique index. Any help would be greatly appreciated.

Not sure I am understanding this :)

If you have a table into which you are importing, then the rules on that
table must be followed. So unique indexes must be respected. If the data
from the source breaks that rule, then you have a problem, and some how
the data must be changed.

I use 'pumps' which select the fields I want and map them to the new
table, so yes I can drop fields, if I don't need them in the output, but
usually that information is needed in some way. In that case, the target
field CAN'T be unique. Since I am normally combining information from a
number of sites, the UNIQUE index becomes (SiteID, ID) and THEN I need a
separate PrimaryID for the table ( I've seen the light ;) )

Hope this helps.

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