Lab-verifiedReproduced and fixed on Oracle AI Database 26ai Free 23.26.3.0.0 · 2026-11-29 · container image gvenzl/oracle-free:23-slim
ORA-00905 means a statement is missing a keyword the syntax requires. The * in SQL*Plus points at the place where the keyword was expected.
On Oracle 23ai/26ai many classic causes (CASE without THEN, JOIN without ON, CREATE VIEW or CAST without AS) now raise ORA-02000 with the exact keyword name instead. In our runs ORA-00905 still came from GRANT and REVOKE with TO or FROM left out. If you see ORA-02000, see that page.
01GRANT SELECT ON table without TO
GRANT SELECT ON orders lab_b; failed with ORA-00905: missing keyword. The * pointed at lab_b, where TO was expected.
With GRANT SELECT ON orders TO lab_b; the grant worked, and lab_b could run SELECT on lab_a.orders and got the row back.
Setup
CREATE TABLE orders (id NUMBER PRIMARY KEY, amount NUMBER);
INSERT INTO orders VALUES (1, 100);
COMMIT;Table created.
1 row created.
Commit complete.GRANT SELECT ON orders lab_b;GRANT SELECT ON orders lab_b
*
ERROR at line 1:
ORA-00905: missing keyword
Help: https://docs.oracle.com/error-help/db/ora-00905/GRANT SELECT ON orders TO lab_b;Grant succeeded.SELECT id, amount FROM lab_a.orders; ID AMOUNT
---------- ----------
1 100
1 row selected.02GRANT system privilege without TO
The same happens with system privileges. GRANT CREATE VIEW lab_b; as system raised ORA-00905 with the * at lab_b.
After GRANT CREATE VIEW TO lab_b;, user_sys_privs for lab_b showed CREATE VIEW.
GRANT CREATE VIEW lab_b;GRANT CREATE VIEW lab_b
*
ERROR at line 1:
ORA-00905: missing keyword
Help: https://docs.oracle.com/error-help/db/ora-00905/GRANT CREATE VIEW TO lab_b;Grant succeeded.COLUMN privilege FORMAT A12
SELECT privilege FROM user_sys_privs WHERE privilege = 'CREATE VIEW';PRIVILEGE
------------
CREATE VIEW
1 row selected.03REVOKE without FROM
REVOKE uses FROM, not TO. REVOKE SELECT ON orders lab_b; raised ORA-00905 at lab_b.
REVOKE SELECT ON orders FROM lab_b; worked, and user_tab_privs_made for ORDERS returned 0 grants.
Setup
CREATE TABLE orders (id NUMBER PRIMARY KEY, amount NUMBER);
GRANT SELECT ON orders TO lab_b;Table created.
Grant succeeded.REVOKE SELECT ON orders lab_b;REVOKE SELECT ON orders lab_b
*
ERROR at line 1:
ORA-00905: missing keyword
Help: https://docs.oracle.com/error-help/db/ora-00905/REVOKE SELECT ON orders FROM lab_b;Revoke succeeded.SELECT COUNT(*) AS grant_count FROM user_tab_privs_made WHERE table_name = 'ORDERS';GRANT_COUNT
-----------
0
1 row selected.FAQ
Where is the missing keyword in ORA-00905?
Look at the * under the statement in SQL*Plus. In the runs above it was under the grantee name, right where TO or FROM should be.
Why do I get ORA-02000 instead of ORA-00905 for CASE or JOIN?
On 23ai/26ai, a missing THEN, ON or AS reports ORA-02000 and names the keyword. ORA-00905 in our runs came from GRANT and REVOKE.
Is it GRANT ... FROM or REVOKE ... TO?
GRANT ... TO user and REVOKE ... FROM user. Swapping or omitting them gives an error; omitting them gave ORA-00905 above.
How we verify
Each scenario starts from fresh database users. A script runs the setup, confirms the exact error code, applies the fix and runs the statement again. The output shown is what the database printed, saved by the script.
lab_a and lab_b are ordinary users created for the test; system is the DBA account. Oracle AI Database 26ai Free Release 23.26.3.0.0 - Develop, Learn, and Run for Free 23.26.3.0.0