Home » SQL & PL/SQL » SQL & PL/SQL » table created but cannot use select
table created but cannot use select [message #7693] Tue, 01 July 2003 11:50 Go to next message
pink
Messages: 23
Registered: July 2003
Junior Member
I created a table using sys account.. But I cannot see it from my account..

What can be done?
Re: table created but cannot use select [message #7694 is a reply to message #7693] Tue, 01 July 2003 12:17 Go to previous messageGo to next message
Roy
Messages: 30
Registered: May 2002
Member
If you have created a table using sys account, it creates it under the 'sys' schema. So unless the table has been granted complete rights to your account, you cannot see it. So try giving a grant connect,resource on the table to your account.
Even if you have full rights to it, you should use select * from sys.tablename to get the information. Otherwise you need to create a public synonym what will allow you to say 'select * from tablename' without having to give 'sys.tablename'.

Rgds
Re: table created but cannot use select [message #7736 is a reply to message #7694] Thu, 03 July 2003 07:59 Go to previous messageGo to next message
pink
Messages: 23
Registered: July 2003
Junior Member
When I create a table in sys and then create a public synonym I still cannot access mt table from my account..

I created table = abc

Then synonymn as

create public synonym abc for me.abc

I cannot still select from table
Re: table created but cannot use select [message #7742 is a reply to message #7736] Thu, 03 July 2003 15:22 Go to previous message
Barbara Boehmer
Messages: 9088
Registered: November 2002
Location: California, USA
Senior Member
If you created table abc in the sys schema, then when referencing it, you need to preface the table name with the schema name, as sys.abc, not me.abc.

In order to grant permission for user me to select from table abc in the sys schema, issue the following while connected as sys:

SQL> GRANT SELECT ON abc TO me;

In order to create a public synonym, you would use:

SQL> CREATE PUBLIC SYNONYM abc for sys.abc;

However, I have to wonder why you are creating anything in the sys schema to begin with, as this is generally a bad practice. Rather than use SYS, create a different schema, create your tables there, then create your public synonms, and grant everyone access.
Previous Topic: absolutely free PLSQL editor/compiler/object viewer
Next Topic: Regarding DROP TABLE....
Goto Forum:
  


Current Time: Thu Apr 18 14:11:20 CDT 2024