English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have to make two tables of same name in Oracle 9i,there structures may be different.

2007-06-30 04:33:41 · 5 answers · asked by deepesh 1 in Computers & Internet Programming & Design

5 answers

You can do it if you place them in different schemas, but then the fully qualified name of the table is not the same any more:

schema1.myTable
vs
schema2.myTable

2007-06-30 05:09:15 · answer #1 · answered by McFate 7 · 0 0

Just out of curiousity why would you need the table names to be the same? #1 it's not doable in the same schema and I don't see any benefit to doing this. Even if you create this in two different schemas you will have to point to your schema.table_name in your SQL or PL/SQL or front end 3GL code. Just use a seperate table name and join based on your primary key. From there you could create a view as mentioned above or pass into your 3GL code to display the appropriate output.

2007-07-02 18:28:53 · answer #2 · answered by Orion 4 · 0 0

you would need to alias the tables to prevent confusion. The tables of the same name can not exist in the same schema

2007-06-30 06:03:57 · answer #3 · answered by Jeffrey F 6 · 0 0

another twist:
If you *got to have* one name,
you could create the 2 different tables as mentioned by junglejungle and then join them (provided they have a common key) under a view which then has the name you desire - but remember views have their own restrictions.

You could also post more information/ details about your question.

Hope that helped.

2007-07-02 07:53:41 · answer #4 · answered by coolblue00 2 · 0 0

nope you can't besides it would be confusing for SQL queries...

you can have tables like

emp_details
emp_job

etc.

but using the EXACT name is confusing. learn up about primary + foreign keys also ;-)

2007-06-30 04:38:46 · answer #5 · answered by junglejungle 7 · 0 0

fedest.com, questions and answers