Subject Re: [IBO] Help a beginner
Author Paul Vinkenoog
Hello James,

> Iam getting a message like this "invalid custom DML column
> reference: RDB$DB_KEY." what does this mean? I have a sql statement
> like this in the query1.sql
>
> select d."invdate", m.*, d2."port", d2."etd" from "invoicedetails" m
> inner join "invoice" d on m."invid" = d."invid"
> left join "packing" d2 on m."packingid" = d2."packingid"

If you make a JOIN in a query, IBO can't figure out for itself which
combination of columns is needed to define each row uniquely. So it
adds a "surrogate primary key column" called RDB$DB_KEY.

I don't know at which point you get the error message and why, but it
would be a good idea to go to the Keylinks tab in the Query Editor,
uncheck "keylinks autodefine" and fill in the keylinks yourself
(keylinks being the combination of columns that is guaranteed to be
unique for each row, or, otherwise put: a combination that can act as
a primary key for the entire join).

Also, I don't know if it's safe to use .* in a joined query. I know
this is perfectly legal SQL so it _should_ work, but I think some
people ran into trouble with this.

HTH,
Paul Vinkenoog