• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Oracle Live SQL - Can I add Tables to a schema after the table already exists?

 
Ranch Foreman
Posts: 880
8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I asked a question a few minutes ago about how to create a schema.   While waiting for an answer  I used the DataBase Object Wizard to create 4 tables.  They do not belong to a schema.   Once I find out how to create a schema will I still be able to put the new tables into the schema?

 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
They do belong to a schema. Every table and view and trigger, etc., etc. belongs to a schema. The question is which schema. Generally it's the default schema. for the database instance.

You can add, alter, and delete elements of a schema (including tables) at any time, although if there is software depending on existing schema definitions, it could potentially break. This, incidentally, is one reason why "SELECT * FROM…" syntax is discouraged.
 
kevin Abel
Ranch Foreman
Posts: 880
8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tim,

I'm hoping that I will be able to use the Tables that I am creating with them belonging to the default schema.   Is there a prefix for the default schema?   Something like defalt.myTable    ?   Do I need the schema prefix?   I guess I will find out when I try.

 
Tim Holloway
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oridinarily you will not need to specify the schema and in fact, when using JDBC I believe that some DBMS's have support for a schema name in JDBC URLs. Note that I am talking generically, Your Mileage May Vary.

The default schema is conventionally named "default" as I recall. You do not need to include it as part of a table identification unless you are currently running out of some other schema.

As a general rule, you'll always be working with the default schema. Alternative schemas would be for exceptional situations where, perhaps a number of clients shared distinct sets of tables in a single database or you were prototyping a new or legacy version of a schema.

Finally, note that "schema" is both a specific database entity type (for databases that support them) and a generic description of the user-visible architecture of a database, Don't confuse the two.

Also, since things do vary, I'd recommend specifically looking in the Oracle documentation for their definition of "schema".
 
kevin Abel
Ranch Foreman
Posts: 880
8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tim,

It has been a year and I did not thank you for this schema information.

Thanks,

Kevin
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic