Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2005
    Posts
    276

    Unanswered: sequences on tables

    Hi,

    I want to check if any sequence has been created on a specific table. Can i do that.

    By giving
    select * from all_sequences;

    you get all the sequences for a user but not the sequences for a table. Can I get this info??
    Please let me know. Thank you in advance.

    Regards,
    Asmitha

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool



    Sequences are not dependent upon tables -- maybe you could check the triggers on tables to see if any dependencies are sequences and check the code to find out if the sequence values are used on that table.

    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  3. #3
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    There is no such thing as a "sequence for a table". You could use the sequence for a million tables if you wanted to. The only way to find out if a sequence might be used for a table, is to look at its triggers and see if they use the sequence. But then the sequence could be used in other triggers for other tables as well. And it could be used in the application directly, or ...

    [edit]
    Too bad, LKBrwn_DBA beat me on the answer ....

  4. #4
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    A sequence is never created on a table, it is a standalone object and nothing links it to a table. However, for that very reason I use the following naming convention (also used by oracle). If the table was named MY_TABLE, then I would name the sequence that I was using with that table as MY_TABLE_S. This makes it simple to match a table with a sequence.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  5. #5
    Join Date
    Jul 2005
    Posts
    276
    Thanks everyone for the info.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •