Informix Error -9998: No privilege to drop a cast of this DISTINCT data type.
Cause and resolution
No privilege to drop a cast of this DISTINCT data type.
You do not have the privilege to drop a cast of this DISTINCT type. By default, after a DISTINCT type is defined, only the owner of the DISTINCT type or a DBA can drop a cast for it. The owner of the DISTINCT type, however, can grant to other users, to PUBLIC, or to roles the Usage privilege on the DISTINCT type.
You should ask the DBA or the owner of the cast to drop the cast, or else to grant you the Usage privilege on the cast so that you can drop it.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-9998 fires when a user without sufficient privilege tries to drop a cast of a DISTINCT type — per the official guidance; by default, only the owner of the DISTINCT type or a DBA can drop a cast for it, though the owner can grant USAGE to others, PUBLIC, or roles.
- The user neither owning the DISTINCT type, being a DBA, nor holding a granted USAGE privilege on it, per the official guidance — the direct, only cause.
Solutions / Resolution
- Ask the DBA or the owner of the cast to drop it, per the official guidance.
- Or ask them to grant you USAGE privilege on the cast so you can drop it yourself, per the official guidance.
Examples
Granting USAGE so another user can drop the cast
GRANT USAGE ON TYPE di TO myuser;
Diagnostic Checks
- Check the DISTINCT type's owner and the executing user's USAGE grant, and either have the owner/DBA drop the cast, or have them grant USAGE first.
Related Errors / Related Topics
- -9997 — "No usage privilege on data type (
)." The general usage- privilege error this is a specific case of, for dropping a cast.
The user lacked privilege to drop the DISTINCT type's cast — have the owner/DBA drop it, or grant USAGE first.