Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to know what sequence a table is using?

Re: How to know what sequence a table is using?

From: gazzag <gareth_at_jamms.org>
Date: 18 Jan 2007 07:14:13 -0800
Message-ID: <1169133252.950119.301070@a75g2000cwd.googlegroups.com>


cyc73 wrote:
> Hi,
>
> Does anyone know how can I know what sequence is being used in a table?
> I know I can get a full list of sequence from ALL_SEQUENCE or
> USER_SEQUENCE. But how do I know which sequence is associate with
> which table? Thank you.
>
> Crystal

You don't. Sequences are not associated with tables. You *might* find that there's a trigger on that table that makes use of that sequence.

>From a SQL*Plus prompt, try:

SQL> select trigger_body from dba_triggers

         where owner='<schema_name>' and table_name='<table_name>';

Also, Oracle encourages the use of sensible naming conventions so *hopefully* there should be a clue in the sequence's name.

HTH -g Received on Thu Jan 18 2007 - 09:14:13 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US