Creating table in other schema [message #537595] |
Thu, 29 December 2011 12:09 |
|
rajubuddha
Messages: 1 Registered: December 2011 Location: India
|
Junior Member |
|
|
Hi Guys ,
I have a query ,
I need to create a structure DATABASE=>SCHEMA=>TABLE as
DB=>SC=>EMPLOYEE ...but after connecting database i could create table only user my user schema(own schema)only .I want to create a new schema called SC as public and need to create a table . Please help me out...
[EDITED by LF: fixed topic title typo; was "Creatingtableinother schema"]
[Updated on: Thu, 29 December 2011 13:15] by Moderator Report message to a moderator
|
|
|
Re: Creatingtableinother schema [message #537602 is a reply to message #537595] |
Thu, 29 December 2011 12:48 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Create a table in your own schema, and then create a public synonym for this table.
SQL> create table test (col number);
Table created.
SQL> insert into test values (123);
1 row created.
SQL> create public synonym test for test;
Synonym created.
SQL> grant select on test to public;
Grant succeeded.
SQL> connect mike/lion
Connected.
Session altered.
SQL> select * from test;
COL
----------
123
SQL>
[EDIT: fixed an example]
[Updated on: Thu, 29 December 2011 12:53] Report message to a moderator
|
|
|
Re: Creatingtableinother schema [message #537606 is a reply to message #537595] |
Thu, 29 December 2011 12:58 |
|
Michel Cadot
Messages: 68732 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Quote: want to create a new schema called SC as public
There is no such thing than public account.
An account can create a table in another schema only if he has the CREATE ANY TABLE privilege which is a privilege you should not grant.
If you need it then either you are a DBA either there is a flaw in your design.
Regards
Michel
|
|
|