Informix Error -315
-315 No create index permission.
This statement tries to create an index for a table. Either you do not have INDEX privilege on this table, or the table itself is a view or synonym. If the table that is named really is a table, contact the owner of the table or a database administrator (see the discussion of error -313) and ask to be granted this privilege.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-315 fires when CREATE INDEX is attempted by a user who lacks the INDEX privilege on the
target table — and, per the official guidance, sometimes because the named object isn't actually
an indexable base table at all, but a view or synonym instead.
- The current user was never granted the
INDEXprivilege on the table — ownership isn't required, but an explicit grant (or DBA status) is. - The named object is a view, not a base table — views generally can't have indexes created directly on them.
- The named object is a synonym, and the privilege needs to be checked/granted against the underlying table rather than the synonym name.
- A privilege that was granted was later revoked, breaking a previously-working index- creation script.
Solutions / Resolution
- Confirm the target is actually a base table, per the official guidance — not a view or
synonym — since those aren't valid
CREATE INDEXtargets in the first place. - Request the
INDEXprivilege from the table owner or a DBA:GRANT INDEX ON orders TO app_user; - If the name is a synonym, resolve it to the underlying table and check/request the privilege there instead.
- Check whether a previously granted privilege was revoked, if a script that used to work now fails.
Examples
Requesting the missing privilege
CREATE INDEX idx_orders_customer ON orders(customer_id);
-- -315: the current user lacks INDEX privilege on orders
Fix — have the owner or a DBA grant it:
GRANT INDEX ON orders TO app_user;
Confirming the target is a real table, not a view
SELECT tabname, tabtype FROM systables WHERE tabname = 'customer_orders';
-- tabtype 'V' means it's a view — CREATE INDEX won't work
-- directly against it regardless of privileges
Diagnostic Checks
- Check
systables.tabtypefor the target name — confirm it'sT(table), notV(view) or a synonym. - Check current privileges on the table for the executing user:
(SELECT t.tabname, a.grantor, a.grantee, a.tabauth FROM systabauth a, systables t WHERE a.tabid = t.tabid AND t.tabname = 'orders';tabauthis a packed privilege-flag string; theINDEXprivilege is one of its positions — consult thesystabauthreference for the exact encoding on the server version in use.)
Related Errors / Related Topics
- -313 — "Not owner of table." A related structural-operation privilege restriction, though ownership-based rather than an explicit granted privilege.
- -302 — "No GRANT option or illegal option on multi-table view." Another privilege/object-type restriction in the same general access-control family.
Confirm the target is genuinely a base table first — a view or synonym can produce this same
message even with adequate privileges, since neither is a valid CREATE INDEX target.