Subject Re: Altering a procedure with an invalid FOREIGN66 reference
Author Alexander V.Nevsky
--- In ib-support@y..., Raymond Kennington <progsol@c...> wrote:
> I have a database with a SP that contains a SELECT join with an
illegal RDB$FOREIGN66
> reference; it should be 67.
[skip]
> I've tried doing this directly in the BLR for the procedure in the
RDB$PROCEDURE table and
> am informed that the type of BLR expected is 4 but it found 98.
>
> What should I do?

Try to:
1. Create empty (begin exit; end) procedure with the same input and
output parameters as this one
2. Copy it's BLR onto BLR of wrong procedure
3. Drop both
4. Create new correct procedure

Don't forget check dependendencies on damaged procedure from
another ones before dropping it and, if they exists, alter them with
commented call and back again after creation of correct. Make all this
in exclusive access to database and don't forget about commits.
Perhaps you will be forced to disconnect/connect in any point due to
metadata cashing.

Best regards, Alexander V.Nevsky.