Getting an exception ORA-00942: table or view does not exist - when inserting into an existing table

前端 未结 10 1365
[愿得一人]
[愿得一人] 2020-11-28 15:17

I am getting below exception, when trying to insert a batch of rows to an existing table

ORA-00942: table or view does not exist

<
10条回答
  •  离开以前
    2020-11-28 15:50

    Is your script providing the schema name, or do you rely on the user logged into the database to select the default schema?

    It might be that you do not name the schema and that you perform your batch with a system user instead of the schema user resulting in the wrong execution context for a script that would work fine if executed by the user that has the target schema set as default schema. Your best action would be to include the schema name in the insert statements:

    INSERT INTO myschema.mytable (mycolums) VALUES ('myvalue')
    

    update: Do you try to bind the table name as bound value in your prepared statement? That won't work.

提交回复
热议问题