I have migrated an old database to SA 12. The database contains tables with the same names but different owners. Because of that I get the error 'Table name xx is ambiguuous'.
Is it possible to change permissions of users in the Sybase Central so that the user can access only the table whose owner it is and the above error does not occur?
I tried to create two groups in Sybase Central and restricted the tables from the 'Table Permissions', but it does not seem to help. Am I doing something wrong?
Edit: After reading Volker Barth's answer I wanted to explain bit more about the problem:
Yes, the problem is causing because the owner of the table is not specified in the application. Please consider following structure:
table1 owner user1 table1 owner user2 table2 owner user1
As you can see there are some tables with unique names, and some have the same name but different owner.
Now there are two groups. both of them have membership to the user1 because both need to use tables owned by both users. Here's example of my groups:
Groups: group1 group2 Group Memberships: group1 membership: user1, PUBLIC group2 membership: user1, PUBLIC Users: userA userB User Memberships: userA (group1, PUBLIC) userB (group2, PUBLIC)
Now if I create the users in the group1, it will NOT have any problem, and it will always use the table1 owned by the user1. However, I need to create a user in group2, so that it can use table 1 owned by the user2 as well as table2 owned by user1.
So, Is it possible to give permission to the group2 of the tables owned by user2 and ONLY those tables of user1 which do not have same name as tables owned by user1? I hope my question makes some sense.
I'll highly appriciate any help regarding this problem.
I still can't give good advice without knowing more details. Just two more suggestions:
That would help to build unambiguous table name sets for all groups, and accessing tables without spcifying the owner name should work.
Some hints can be found here:
I assume the error message results from accessing the table without specifying the owner name, as the combination of owner and object name MUST be non-ambiguous.
There are the different concepts of visibility/name scope vs. permissions (note: there may be better terms for these notions) that do matter here: