Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2009
    Posts
    55

    Unanswered: auto rotation table in oracle

    Hi,
    Is there any strcuture or fucntion that can make the table have something like rotation.
    I mean the record can be first in first delete.
    So,for example , even the table have limit row for example , 100 row .
    so, the new data can be replace the oldest row in the table auto and insert into the table .
    so the new row will replace the oldest 99 th row auto .the table still keep 100 row but the data can be update .
    Is it "partition" or other ??
    how can I create it .
    Please give me in detailed

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    This could be implemented using a trigger, but I'd like to understand the business requirement that would need such a solution.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Upon more reflection, I question whether this logic could be implemented in a trigger without getting the dreaded "mutating table" error.
    In a multiuser environment the logic could be very complex due to Read Consistency for individual sessions.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

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

    Cool FIFO anyone?

    Quote Originally Posted by chuikingman View Post
    Hi,
    Is there any strcuture or fucntion that can make the table have something like rotation.
    I mean the record can be first in first delete.
    ...etc...
    I agree with anacedent on the need of such a business requirement.

    What you are trying to implement (if I read understood correctly) is the first in - first out queue processing technique.

    1) Create a type varray of record type.
    2) Create a table with columns: queue_id, last_item and the the_varray type.
    3) Create procedure to insert/select/update a queue.
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

Posting Permissions

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