Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting into other users table using synonym prob

Status
Not open for further replies.

haste

Programmer
Feb 27, 2005
96
GH
There's a procedure called in before a before insert trigger that insert records into a table f_currency using a synonym p_currency, however on attempting to insert I get a primary key violation error in the f_currency's index. f_currency doesn't have any keys so I wondered how oracle created this index. The table f_currency belongs to user B. User B has granted all object privileges to my user without admin option. My user doesn't have any object privileges to the index which I assume should come with the synonym privs.
Does anyone have any clues as to why I can't insert a record using the synonym
 
Does your code work if you specify B as the table owner?

Code:
INSERT INTO B.f_currency.....

If so, then check your synonym points to the right owner.

What is the exact error you are getting?
 
Most probably you're inserting into another object named p_currency (either your own table/view or private synonym for another object)

Regards, Dima
 
The error:
Code:
ORA-00001: unique constraint (B.P_CURRENCY) violated
ORA-06512: at "myuser.STP_P_CURRENCY", line 22
ORA-06512: at "myuser.TRG_P_CURRENCY", line 27
ORA-04088: error during execution of trigger 'myuser.TRG_PM_CURRENCY'

STP_P_CURRENCY inserts records into P_CURRENCY.

>If so, then check your synonym points to the right owner

The synonym does point to the right owner
 
Correction on errors:
Code:
ORA-00001: unique constraint (B.PK_P_CURRENCY) violated
ORA-06512: at "myuser.STP_P_CURRENCY", line 22
ORA-06512: at "myuser.TRG_P_CURRENCY", line 27
ORA-04088: error during execution of trigger 'myuser.TRG_PM_CURRENCY'

 
Aer you sure your synonym points to B.F_CURRENCY instead of B.P_CURRENCY?

 
lewisp,
My apologisies mixed the names. The synonym points to B.P_CURRENCY.

sem,
there aren't any other objects with the name P_CURRENCY except the synonym and the table owned by B.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top