Informix Error -323
-323 Cannot grant permission on temporary table.
This GRANT statement names a temporary table. That action is not supported. Privileges are recorded only for permanent tables. Because temporary tables are not recorded in the system catalogs, no place exists to record privileges on them. Only the person who creates a temporary table can access it.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-323 is a structural impossibility rather than an ordinary permission mistake: temporary tables
aren't recorded in the system catalogs at all, so there's no place to store a GRANT's privilege
record against one. By design, only the session that created a temporary table can ever access
it — there's no privilege system to layer on top of that.
- A
GRANTstatement targeting a table created withCREATE TEMP TABLE(orSELECT ... INTO TEMP) — the direct, only cause. - Confusion about the intended scope of a temp table — expecting other sessions or users to be able to access it, when temp tables are inherently private to the creating session.
- Copy-pasted
GRANTlogic from a permanent-table setup script applied unmodified to a temp-table-based workflow.
Solutions / Resolution
- Don't attempt to grant privileges on a temporary table, per the official guidance — it's architecturally not possible, not just restricted.
- If other sessions genuinely need to access the data, use a permanent table instead (with appropriate cleanup), and grant privileges on that.
- If the goal is per-session scratch space that only the creating session needs, no
GRANTis necessary at all — that's already the default and only possible behavior for temp tables.
Examples
Attempting to grant on a temp table
SELECT * FROM orders WHERE status = 'pending' INTO TEMP recent_orders;
GRANT SELECT ON recent_orders TO report_user;
-- -323: recent_orders is a temp table; nothing to grant against
Fix — use a permanent table if cross-session/cross-user access is genuinely needed:
SELECT * FROM orders WHERE status = 'pending' INTO TEMP recent_orders_working;
-- ... process temp data ...
CREATE TABLE recent_orders_snapshot AS SELECT * FROM recent_orders_working;
GRANT SELECT ON recent_orders_snapshot TO report_user;
Diagnostic Checks
- Confirm whether the target table is temporary (
CREATE TEMP TABLEor... INTO TEMP) — if so, noGRANTwill ever succeed against it, regardless of privilege level. - Clarify the actual access requirement — if cross-session access is needed, a permanent table is the only option.
Related Errors / Related Topics
- -298 — "Cannot grant permission to public with grant option." Another
GRANT-clause restriction in the same privilege-management family. - -299 — "Cannot grant permission to self." A related sibling in the same
GRANT-validation family.
Temporary tables have no catalog entry to attach a privilege to — if other sessions need access, the data has to live in a permanent table instead.