|
|
|
|
Re: how to know sequence name on a table? [message #396638 is a reply to message #396096] |
Tue, 07 April 2009 07:06   |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
There is a school of database design that advocates using a single sequence for all your tables, or at least for all of each group of tables that have PK-FK links to each other.
It makes it much easier to spot when you've joined colums incorrectly, as you suddenly stop getting any results - each FK id value matches with only on other id value in the whole db.
|
|
|
Re: how to know sequence name on a table? [message #396668 is a reply to message #396638] |
Tue, 07 April 2009 09:25   |
nastyjillu
Messages: 211 Registered: February 2009
|
Senior Member |
|
|
yes i know that a SEQUENCE can be used by many tables.
but if i want to know the name of a SEQUENCE used by a table what i have to do?? i didnot find that information in table description (by pressing F4 in toad on table name).
|
|
|
|
|
Re: how to know sequence name on a table? [message #396849 is a reply to message #396096] |
Wed, 08 April 2009 02:54   |
Nithinks
Messages: 1 Registered: April 2009 Location: India
|
Junior Member |
|
|
Hi,
It is time to go for a trial and error method to find the sequence used, if you don't find the code which inserts into the table. You may find the largest number in the table and try to match it with the highest sequence value generated.This may help you to figure out the sequence in some cases.
Nithin
|
|
|
Re: how to know sequence name on a table? [message #396860 is a reply to message #396668] |
Wed, 08 April 2009 03:14   |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
The most likely place to find a sequence being used to popuate a primary key column on a table is in a Before Inset trigger, that fires for every row inserted.
Look in USER_TRIGGERS.
It' is quite possible that the sequence is used in the initial INSERT statement, in which case you'll have to look through all the dependant objects manually.
|
|
|
|