![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I am working on oracle database which has a few tables that do not have any primary keys. Unfortunately, I cannot modify the table designs. I need to find out the fields in the table that make the record unique. I am not very familiar with Oracle and its system tables, but am pretty sure I should be able to get this information from some system table. Any help is greatly appreciated. Regards, MounilK |
#3
| |||
| |||
|
|
Hi, I am working on oracle database which has a few tables that do not have any primary keys. Unfortunately, I cannot modify the table designs. I need to find out the fields in the table that make the record unique. I am not very familiar with Oracle and its system tables, but am pretty sure I should be able to get this information from some system table. Any help is greatly appreciated. Regards, MounilK |
#4
| |||
| |||
|
|
On Tue, 27 Jul 2010 22:16:44 -0700, Mounilk wrote: I am working on oracle database which has a few tables that do not have any primary keys. Unfortunately, I cannot modify the table designs. I need to find out the fields in the table that make the record unique. I am not very familiar with Oracle and its system tables, but am pretty sure I should be able to get this information from some system table. Any help is greatly appreciated. Why would a RDBMS need to maintain a record of uniqueness? How would it do that? Nope, there are tools which allow you to determine whether there are duplicates and add unique constraints. RDBMS per se does not maintain anything about the uniqueness of columns nor is it required to. |
#5
| |||
| |||
|
|
Hi, I am working on oracle database which has a few tables that do not have any primary keys. Unfortunately, I cannot modify the table designs. I need to find out the fields in the table that make the record unique. I am not very familiar with Oracle and its system tables, but am pretty sure I should be able to get this information from some system table. Any help is greatly appreciated. Regards, MounilK |
#6
| |||
| |||
|
|
Hi, I am working on oracle database which has a few tables that do not have any primary keys. Unfortunately, I cannot modify the table designs. I need to find out the fields in the table that make the record unique. |
|
I am not very familiar with Oracle and its system tables, but am pretty sure I should be able to get this information from some system table. Any help is greatly appreciated. Regards, MounilK |
#7
| |||
| |||
|
|
What exactly is your need? I work on a database that has many tables with no primary keys, so the app makes assumptions... |
#8
| |||
| |||
|
|
On Wed, 28 Jul 2010 10:18:03 -0700, joel garry wrote: What exactly is your need? *I work on *a database that has many tables with no primary keys, so the app makes assumptions... Having tables with no primary keys is usually a sign of poor design, and therefore the application itself is extremely suspicious. When table is created, there must be some kind of criteria for identifying the records and selecting them from the table. That is what the primary keys are for. There has been, as you're probably well aware, a long debate about "natural" vs. "generated" (or "unnatural") primary key. Each approach has its advantages but there must be a primary key for every table. --http://mgogala.byethost5.com |
#9
| |||
| |||
|
|
On Wed, 28 Jul 2010 10:18:03 -0700, joel garry wrote: What exactly is your need? *I work on *a database that has many tables with no primary keys, so the app makes assumptions... Having tables with no primary keys is usually a sign of poor design, and therefore the application itself is extremely suspicious. When table is created, there must be some kind of criteria for identifying the records and selecting them from the table. That is what the primary keys are for. There has been, as you're probably well aware, a long debate about "natural" vs. "generated" (or "unnatural") primary key. Each approach has its advantages but there must be a primary key for every table. --http://mgogala.byethost5.com |
#10
| |||
| |||
|
|
On Jul 28, 10:32*pm, Mladen Gogala <gogala.mla... (AT) gmail (DOT) com> wrote: On Wed, 28 Jul 2010 10:18:03 -0700, joel garry wrote: What exactly is your need? *I work on *a database that has many tables with no primary keys, so the app makes assumptions... Having tables with no primary keys is usually a sign of poor design, and therefore the application itself is extremely suspicious. When table is created, there must be some kind of criteria for identifying the records and selecting them from the table. That is what the primary keys are for. There has been, as you're probably well aware, a long debate about "natural" vs. "generated" (or "unnatural") primary key. Each approach has its advantages but there must be a primary key for every table. --http://mgogala.byethost5.com As a historical note it used to be very common for vendor products to not declare PK constraints in the database but to include unique indexes on the tables. *This was in part because some database products did not support constraints and in part due to the menatality of "if I have a unique index why do I need to declare a PK constraint also". *As mgogala said the application really should be using PK, UK, and FK constraints. As mentioned dba_indexes can be used to find indexes built with the unique attribute and dba_ind_columns can be used to find the list of columns that make up the index. HTH -- Mark D Powell -- |
![]() |
| Thread Tools | |
| Display Modes | |
| |