Subject Modification to IB_WISQL
Author Nando Dessena
Hello,
I have made a small modification to IB_WISQL (more precisely to the
IBF_Browse unit) so that you can double click on the INDEX NAME box in
the Constraints page to automatically move to the corresponding index in
the Indexes page, if available.
It is really nothing special, but I find it useful so if anyone else
needs it I can send the modified file.

While we're at it, I attempted another small modification, to allow me
to double click on the "Unique constraint in the parent" box and jump to
that constraint.
To do that, I needed an additional field in qrConstraintInf, so I have
modified this SQL sentence:

SELECT RC.RDB$CONSTRAINT_NAME
, RC.RDB$CONSTRAINT_TYPE
, RC.RDB$DEFERRABLE
, RC.RDB$INITIALLY_DEFERRED
, RC.RDB$INDEX_NAME
, FC.RDB$CONST_NAME_UQ
, FC.RDB$UPDATE_RULE
, FC.RDB$DELETE_RULE
, RC2.RDB$RELATION_NAME PARENT_RELATION
FROM RDB$RELATION_CONSTRAINTS RC
LEFT
JOIN RDB$REF_CONSTRAINTS FC
ON RC.RDB$CONSTRAINT_NAME = FC.RDB$CONSTRAINT_NAME
ORDER BY RC.RDB$CONSTRAINT_NAME

adding

LEFT
JOIN RDB$RELATION_CONSTRAINTS RC2
ON FC.RDB$CONST_NAME_UQ = RC2.RDB$CONSTRAINT_NAME

just before the ORDER BY, but this screws up the MasterLinks entry,
which is

RDB$RELATION_CONSTRAINTS.RDB$RELATION_NAME=RDB$RELATIONS.RDB$RELATION_NAME

It appears that IBO is using the
RDB$RELATION_CONSTRAINTS.RDB$RELATION_NAME column from RC2 and not RC.
What should I do in such circumstances?
For now, I have used a subselect in place of the left join, which seems
to work OK, but I don't know whether there are better solutions.

I have also made it so that the parent relation is displayed in the
group box, and that the group box itself is not shown if the current
constraint is not a FK.
Any chance to include these small modifications in a next release?

Ciao
--
____
_/\/ando