1

I am using asp.net core oracle entity framework. I am writing default connection to appsettings.json

But I got

Oracle.ManagedDataAccess.Client.OracleException: 'ORA-00942: The table or schema doesnt exist.

I think I make mistake at connection string but I dont know where

my database name TEST my schema name DBTEST( all my db table inside this i must to connect to dbtest for insert ,select or update ) but I couldn't so that I got table or view doesn't exist.

 "DefaultConnection": "Data
 Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST= ip
 )(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=test)(SERVER=TEST)));User
 Id=UserName;Password=*******;"

3 Answers 3

1

ORA-00942: The table or schema doesnt exist.

This means that connection was successful, but you got error during parsing your query. You need to check your query.

Sign up to request clarification or add additional context in comments.

Comments

1

The error is clear, either the table is not there or your user ( the one you connect with ) has no privileges to see the table.

You need to run:

SQL> GRANT SELECT, INSERT, DELETE, UPDATE ON SCHEMA.TABLE_NAME TO USER ;

Replace schema.table_name for your schema and table, and user for TEST, in your case.

Comments

0

Use special attributes for the class that represents the table in your DbContext to determine which DB table you are refering to. Use upper case to match the Oracle table.

    [Table(name:"BANK_ORDERS", Schema ="STAGING")]
    public class Orders
    {
        [Column("ID")]
        public string Id { get; set; }   

Example for table STAGING.BANK_ORDERS

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.