Cant execute query [message #538499] |
Fri, 06 January 2012 10:18 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.gravatar.com/avatar/b67bac86347893e6e46078bde5fbf06f?s=64&d=mm&r=g) |
winnitbaker
Messages: 20 Registered: January 2012
|
Junior Member |
|
|
Hi, I currentl have a form and when I am logged in as the owner the execute query button can be performed. But when I try and do this with another user the query cannot be executed. I have granted the users with the correct privilidges. I have created synonyms but this did not fix the problem. I am now trying to re-create the data block but with using the synonym but the synonyms cannot be found. Please help !!
|
|
|
|
Re: Cant execute query [message #538537 is a reply to message #538499] |
Fri, 06 January 2012 13:31 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
Sounds like you either made private synonyms in the wrong place, you didn't grant proper privileges on the underlying tables, or you gave incorrect grants.
Without knowing what you actually did, saying you "did" something really is no proof at all.
|
|
|
|
Re: Cant execute query [message #538587 is a reply to message #538584] |
Sat, 07 January 2012 08:37 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21818 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Here's what I think you did.
I'm connected as SCOTT. Create a table:
SQL> create table my_client
2 (id number,
3 cli_name varchar2(20));
Table created.
SQL> insert into my_client (id, cli_name) values (100, 'Littlefoot');
1 row created.
SQL> create public synonym my_client_syn for my_client;
Synonym created.
SQL> select * from my_client_syn;
ID CLI_NAME
---------- --------------------
100 Littlefoot
So far, so good. Now connect as another user (MIKE) and try to select from that public synonym:
SQL> connect mike/lion
Connected.
SQL> select * from my_client_syn;
select * from my_client_syn
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL>
Exactly the same error as the one you got.
OK, a step back: connect as the table owner again (SCOTT in my case):SQL> connect scott/tiger
Connected.
Session altered.
SQL> grant select on my_client to public;
Grant succeeded.
OK, connect as MIKE again and try to select from the synonym:
SQL> connect mike/lion
Connected.
SQL> select * from my_client_syn;
ID CLI_NAME
---------- --------------------
100 Littlefoot
SQL>
Success!
So - did you, perhaps, forget to GRANT SELECT (and possibly other privileges) to PUBLIC?
[Updated on: Sat, 07 January 2012 08:38] Report message to a moderator
|
|
|
|
|
|
|