You created the table in the SYS
schema (which you should never, ever do. Really, never).
When you log in as teacher1
any statement looks for objects in that schema. But there is no TEACHER1.INSTRUCTORS
table, because the real name is SYS.INSTRUCTORS
(did I mention what a bad idea it is to create objects in the SYS schema?).
You need to run select * from sys.instructors
to get access to that table. If you don't want to prefix the table name with the schema, create a synonym in the teacher1
schema:
create synonym teacher1.instructors for sys.instructors;
Then teacher1
can access the table from the SYS
schema without fully qualifying it.
Again: stop using the SYS or SYSTEM account for anything that is not DBA stuff. Use a regular account for that.
Thanks Balazs papp ,
your answer was right 100% , i have used the following code :
EXECUTE IMMEDIATE 'INSERT INTO '|| CUR_MONTH ||' (
MT_ID ,
CL_ID ,
OP_ID ,
MT_PORT ,
MT_COST_TAG ,
MT_MSISDN ,
MT_TYPE_ID ,
MT_MSG ,
MT_RECEIVED_TIME ,
MT_PROCESSED ,
MT_STATUS ,
MT_DELIVERED ,
MT_DELIVERED_DETAILED ,
MT_DR_IS_EXPIRED ,
MT_IP ,
MT_RESPONSE_DESC
)
VALUES (
:b1,:b2,:b3,:b4,:b5,:b6,:b7,:b8,:b9,:b10,:b11,:b12,:b13,:b14,:b15,:b16
)'
USING
I.MT_ID ,
I.CL_ID ,
I.OP_ID ,
I.MT_PORT ,
I.MT_COST_TAG ,
I.MT_MSISDN ,
I.MT_TYPE_ID ,
I.MT_MSG ,
I.MT_RECEIVED_TIME ,
I.MT_PROCESSED ,
I.MT_STATUS ,
I.MT_DELIVERED ,
I.MT_DELIVERED_DETAILED ,
I.MT_DR_IS_EXPIRED ,
I.MT_IP ,
I.MT_RESPONSE_DESC
;
Best Answer
Synonyms have nothing to do with privileges. They are simply a way to simplify naming.
The error you are getting appears to indicate that
user_app
does not have privileges on theuser.clients
table. You'd need to grant thatOf course, in your actual system, I'm guessing that there is a role that you would grant privileges to and that role would be granted to
user_app
.