sqloracle-databaseoracle11g

Oracle thinks table doesn't exist during alter


I'm trying to alter a column on a table with this syntax:

ALTER TABLE MY_SCHEMA.latest_workspace MODIFY (short_name VARCHAR2(10) NOT NULL);

This is the error I'm getting:

Error starting at line 1 in command: ALTER TABLE MY_SCHEMA.latest_workspace MODIFY (short_name VARCHAR2(10) NOT NULL) Error report: SQL Error: ORA-00942: table or view does not exist 00942. 00000 - "table or view does not exist" *Cause:
*Action:

However, I can physically see the table just fine and query it with:

SELECT short_name FROM MY_SCHEMA.latest_workspace;

Also, all the correct permissions are granted to the user that I am logged in with. Is there something else I'm forgetting that can cause this for an ALTER?

Thanks!


Solution

  • It would appear MY_SCHEMA.latest_workspace is not a table. It might be a view, or perhaps it's a synonym to an object in some other schema. Try this query to find out:

    select object_type
    from   user_objects
    where object_name = 'LATEST_WORKSPACE';
    

    The action you need to take subsequently depends on the result.