Gap in Sequence

Hi,
I created a sequence and a trigger for autonumber, as a primary key in my CAND_PERSONAL_INFO table. Every time i insert a row in the table, i get long gaps between my autonumber. I don't understand why cant i get a series of numbers without any gaps in my autonumber column.

Sequence is not a good way of automatically generating the numbers due this gap problem.I disagree. Sequences are the best for auto-generating unique numbers. Why are gaps a problem?
The second solution is to fire a query select max(num) and add 1 to it every time you want to generate a number. That is a horrible idea in a multi-user environment. This will fail when 2 users do this at the time.

Similar Messages

  • How to remove gap in sequence?

    Hi,
    SELECT MENU_ITEMID.NEXTVAL INTO :MENU_ITEM.M_ITEM_ID
    FROM SYS.DUAL;
    EXCEPTION
    WHEN OTHERS THEN MESSAGE ('FAILED');
    RAISE FORM_TRIGGER_FAILURE;
    I have applied the above PRE-INSERT trigger on my MENU_ITEM FORM.
    I was inserting values but when I was inserting the 53th item my PC was struck by a power failure, I did not commit or Rollback and next item when I rebooted my system and tried to insert the 53th item in my form it gave me a gap and jumped to 54th item directly.
    Now How can I remove this gap?
    I tried to insert the ids manually using INSERT command,
    INSERT INTO MENU_ITEM VALUES (53, 'AAAA');
    INSERT INTO MENU_ITEM VALUES (54, 'BBAAA');
    INSERT INTO MENU_ITEM VALUES (55, 'UUAA');
    but when I opened the application form then it showed the wrong order of id column.
    like
    53
    55
    54
    and so on.
    I deleted the newly inserted records using this command, DELETE from MENU_ITEM where M_ITEM_ID in(53,54,55);
    COMMIT;
    and then i queried the nextval of sequence.
    and it was 55.
    now I want tthe solution to solve this.
    Please Help me that where I can find the solution?
    Thanks In advance
    Natalia

    I'm afraid you do not understand how a SEQUENCE works.
    A sequence is a "one-time" sheet. Once we have got a number through NEXTVAL the sequence can never give us that number again (unless we created the sequence with the CYCLE clause, in which case we'll see it again, eventually). NEXTVAL is a piece of DDL, so we cannot roll it back. We can only fill in the gaps manually, as you did. You, however, overshot and inserted a row with an ID 55 that was in advance of the last number assigned by the sequence.
    Also note that the SEQUENCE number has a CACHE; this is the default behaviour, because it is memory efficient. As a side effect, if the database goes down, assigned numbers in the cache may be lost. We can avoid this with the NOCACHE option, but it makes sequence usage slower. It depends: do we need every number in the range or can we cope with gaps? As most sequence usage is simply to assign uniqueness gaps do not matter. They do matter in some circumstances, e.g. in an audit subsystem.
    The LAST_NUMBER column on USER_SEQUENCES shows the last number assigned. But, as the example below shows, beware. Before we have called the sequence in this session, LAST_NUMBER shows the actual last number given by the sequence. Once the sequence has satisfied a NEXTVAL call the LAST_NUMBER column shows the last number in the current cache. We can see the actual last number assigned with a CURRVAL statement.
    Regards, APC
    P.S. The rows in your block are being displayed in the "wrong" order because your block does not have an ORDER BY property to sort rows by ID.
    SQL> CREATE SEQUENCE test_seq;
    Sequence created.
    SQL> SELECT last_number, cache_size
      2  FROM   user_sequences
      3  WHERE  sequence_name = 'TEST_SEQ';
    LAST_NUMBER CACHE_SIZE                                                         
              1         20                                                         
    SQL> SELECT test_seq.NEXTVAL FROM dual;
       NEXTVAL                                                                     
             1                                                                     
    SQL> SELECT last_number, cache_size
      2  FROM   user_sequences
      3  WHERE  sequence_name = 'TEST_SEQ';
    LAST_NUMBER CACHE_SIZE                                                         
             21         20                                                         
    SQL> SELECT test_seq.NEXTVAL FROM dual;
       NEXTVAL                                                                     
             2                                                                     
    SQL> SELECT last_number, cache_size
      2  FROM   user_sequences
      3  WHERE  sequence_name = 'TEST_SEQ';
    LAST_NUMBER CACHE_SIZE                                                         
             21         20                                                         
    SQL> SELECT test_seq.NEXTVAL FROM dual;
       NEXTVAL                                                                     
             3                                                                     
    SQL> ROOLBACK;
    Rollback complete.
    SQL> SELECT last_number, cache_size
      2  FROM   user_sequences
      3  WHERE  sequence_name = 'TEST_SEQ';
    LAST_NUMBER CACHE_SIZE                                                         
             21         20                                                         
    SQL> SELECT test_seq.NEXTVAL FROM dual;
       NEXTVAL
             4
    SQL> SELECT last_number, cache_size
      2  FROM   user_sequences
      3  WHERE  sequence_name = 'TEST_SEQ';
    LAST_NUMBER CACHE_SIZE
             21         20
    SQL> SELECT test_seq.CURRVAL FROM dual;
       NEXTVAL
             4
    SQL>

  • Gaps in sequences set to cache

    Would like to know if sequences are set to cache is it possable to see gaps in the sequence when a process like rman or a long period of time accures.
    I am trying to pin down why we have gaps. I read a little about if the system comes down then the sequence in cache memory would be lost and Oracle would get the next set of numbers.
    10.2.0.4
    linux
    Thank you,
    Steve

    user12551219 wrote:
    Would like to know if sequences are set to cache is it possable to see gaps in the sequence when a process like rman or a long period of time accures.
    I am trying to pin down why we have gaps. IOracle sequences will always have gaps for various reasons, a rollback is one, caching and database shutdowns are others. Caching sequences produces better performance.
    The answer is to not care that sequences have gaps.
    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:4343369880986
    A sequence is a unique identifier and not a counter, storing a row count in a table is non-relational and does not perform or scale. If rows need to be counted they should be counted when they are selected.
    If you are concerned about losing numbers because you may run out, I wouldn't worry about that for a while either.
    Re: What kind of transaction in procedure?

  • Encore adding gaps between sequences in timeline

    I have a project with 11 dynamically linked PPro sequences in the Encore timeline. When I reopen the project, Encore has placed 3-frame gaps between some of the sequences. Here's my workflow:
    1. I created an Encore project with the DL sequences, created a menu, and built a DVD image file.
    2. Burned the DVD in Toast, watched it, made notes.
    3. Edited audio in several reels in Audition, updated the Premiere sequences with the new audio.
    4. Opened the Encore project -- it asked if I wished to re-import the DL sequences that had changed on the DL server -- Yes.
    5. Now Encore seems to have trimmed the tail of the unchanged sequences by 3 frames, but only the video.
    Even though Encore gives be a bi-directional trim icon at the tail, indicating that I should be able to trim it in either direction, it won't add those frames back, at least not on all the sequences -- some of the sequences do let me add the frames back.
    When I do trim the previous sequence, it snaps to the nearest I-frame. Apparently, it's trimming the previous sequence to the last I-frame it transcoded instead of leaving it trimmed to the last frame in the sequence.
    How can I get around this?

    Excellent. I don't understand how Encore could ask you if you wanted to reimport changed sequences if it was not reverting to original. I now assume that Encore does not address the possibility that you might have multiple sequences on one timeline when it does this process, and does not revert all (or any?) and produced the gaps.
    So, in any event, your multiple DL sequences on one timeline worked, once you reverted and adjusted. The alternative to what you did would be to answer "no" to reimporting, then revert (which would pull in the newer version). If it was not actual changes that contributed to the gaps, that might avoid them. But I suspect you would still have to adjust the sequences on the original timeline.

  • Gap in Sequences

    Hi all,
    I have been using a sequence to populate a bank_acct_no. Is this recommended?
    I just noticed that there exist a skip in the sequence number. How can I avoid this?
    Thanks

    EdStevens wrote:
    jgarry wrote:
    Check printing requires the computer data and the paper data to be synchronized. It is not something to be shared among users. Yes, you can blow a ream of checks, the printer can jam, a new printer can have a different version of the same pcl language and act strange, and so forth, so stating the requirement as gap-free is a mis-statement, focusing too much on the software mechanics rather than the design. It's an accounting issue of accountability. However you solve it, Oracle sequences are not the way.
    The news this morning had a military wife working in a doctor's office grabbing $200K by simply writing herself checks... over two years. That's bad accounting, assisted by bad accounting software implementation. You never give one person that much power. But it's par.Years ago (26+) I spent a miserable year working for a major car rental company. They would regularly blow a case of checks due to printer jams. The biggest issue was the operator not confirming a good print run before 'commiting' the check numbers. This would necessitate me coming in at 2:00 am to run a rollback job. (Yes, this data center had multiple QC issues due to self-imposed procedures - and poor printer maintenance). I don't remember how the accounting department accounted for the ruined checks and their numbers. It's obviously been a long time since working on such a system, but I'd think that with check printing and similar applications, the check number would still be generated out of a local variable, initialized by an operator at run time. (As you said, Oracle sequences are not the solution for this application). Actually, my current application has a similar requirement, that batches of documents have gapless sequence numbers. But that is only within the batch, so just like the checks, the app just keeps a counter in memory at run time and the operator tells it where to start.1981 or so I remember a requirement from the gummint that some annual tax forms, if submitted by computer output, had to be printed with the multipart forms continuously joined. With this stupid old chain-drive printer, it took hours and hours and a whole box of forms to print something like 300 of them.
    I recently got some checks from the company that does pretax (section 125) health payments that were printed so bad they couldn't be read by ATMs (I tried 3 different branches, finally had to see a clerk).

  • Find gaps in sequence of numbers

    Hi,
    I'm trying to scan through multiple records containing millions of numbers. What I need to do is to print out the numbers that are sequential as such:
    If the record contains a sequence like this:
    46859995600
    46859995699
    And there is no breakage in that sequence, then print:
    46859995600 100
    If that sequence is broken somewhere, then print series of 10 that are sequential, f.e:
    46859995600 10
    46859995620 10
    46859995630 10
    I already have a bash script for this, but it's way too slow. If anyone can help me out I'd be very grateful, perhaps a "awk" solution.
    Thanks!

    Indeed.  Also, note that the code above makes several assumptions: 1) monotonicity ... but "sort" can take care of that; 2) there is no zero.  This would be easy to fix, but in the first draft I didn't bother with it: 000-009 will not currently be counted; 3) the application is not mission critical; 4) there are no blank line; 5) each line contains *only* the number.
    On #3, my code may be faster, but it hasn't been checked for accuracy.  Be sure to test for accuracy before trusting its output.  In fact, I just tested it ... it failed.
    I tested it after I recoded it in C.  The speed went from 2min 3sec to 0.39sec ... that's nice.  But the results file was *much* smaller.
    The results from the bash version includes several duplicates, and some erroneous inclusions.  Given that so far the C version seems more accurate (but still needs testing) and *much* faster, I'd go with patching this up further:
    #include <stdlib.h>
    #include <stdio.h>
    #include <string.h>
    unsigned long lt = 0, lh = 0;
    unsigned long n, prev = 0, tens[10];
    int nten=0;
    void check_tens() {
    int i;
    if (lh) printf("%lu 100\n",lh);
    else for (i = 0; i < 10 && tens[i]; i++)
    printf("%lu 10\n",tens[i]);
    memset(tens,0,10*sizeof(unsigned long));
    nten = 0;
    int main() {
    int i;
    memset(tens,0,10*sizeof(unsigned long));
    while (fscanf(stdin,"%lu\n",&n) == 1) {
    if ((n % 10) == 0) lt = n;
    else if ((n % 10) == 9) {
    if (!lt || n - 9 == lt) tens[nten++] = lt;
    lt = 0;
    if ((n % 100) == 0) lh = n;
    else if ((n % 100) == 99) check_tens();
    if (n - prev != 1) {
    lt = lh = 0;
    for (i = prev; i < n; i++)
    if ((i % 100) == 99) { check_tens(); break; }
    if ((n % 10) == 0) lt = n;
    if ((n % 100) == 0) lh = n;
    prev=n;
    lh = 0;
    check_tens();
    return 0;
    EDIT: I can actually confirm the C version is not yet accurate.  ARGH!
    Last edited by Trilby (2014-05-02 00:11:09)

  • Gaps in Scheduling  - PPDS

    Hi All,
    The issue concerned is gaps appear when rescheduling in Planning board.The operation one before the last operation in an order is shorter in duration than the last operation and when the orders are grouped for the same operation in the resource, the gaps occur in rescheduling.
    Tried the reduce gaps in scheduling schequence, but no joy.The strategy used is backward scheduling.Trying to close gaps between the orders for the same operation in that specific resource.
    Any help much appreciated.
    Regards
    Venkat

    Hi Venkat,
    gaps occur whenever there is a constraint which prevents the operations to be one after the other on one resource. These constraints can be order internal relationships, pegging relationships, capacity constraints, etc.
    A schedule without gaps is only possible if all these constraints can be fulfilled without preventing the gap-less sequence on the resource.
    If a gap-less sequence on one resource is a business constraint which must be fulfilled then you have to weaken the other constraints which prevent the gap-less sequence. The first candidate for this is usually the finiteness of the other resources: Usually in a scenario like yours it is probably not so important to have all resources finite but only the one resource which has this strong sequence constraint.
    So, think about your scenario and your constraints and try to find out which one prevent the sequence and if you can do without it.
    Best regards
    Thomas

  • Daily sequence number

    Hi,
    I need a clean solution for a daily sequence number (starts from 1 everyday). Clean in the sense that upon initial setup, I do not have to do anything and I can get my number everyday by just one jdbc call/query.
    Thank you in advance.

    What is the business justification for this requirement? Normally, you should just use a regular non-resetting sequence. If users want to see a "pretty" sequence number, simply generate something for them when you query the data using the row_number, rank, or dense_rank analytic functions. If users want to see sequences reset, they probably also want to see gap-free sequences, which is not something that you can ever guarantee in a scalable system where multiple users are allowed, though you can present gap-free sequences of values at query time.
    You can have a job that either drops and recreates the sequence every day or that goes through some logic to reset the sequence to 1 by changing the increment. This gets rather hairy, though, because the job will fail (or fail to run) on occasion and requires that no one be processing data at the time.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Table Sequence number

    Hi All,
    I have a scenario which goes like this:
    We have a common table(Table1) in our DB which maintains the sequence numbers(we are not using oracle supplied db sequence).
    For every transaction we are using the current sequence number from the table Table1 and put in Table2, while saving
    we increment that number by 1 in Table1 for next transactions use. For every transaction the sequence number should be unique.
    At any point of time a record with same sequence number should not be inserted in Table2.
    In Table2 this sequnce number is not a unique column.
    To achieve this, we are checking using view object whether current sequence num already exists in Table2 before saving.
    If exists we refresh with new number from Table1. In normal scenario this works fine.
    But if concurrent users are accessing, there are cases where same sequence number getting inserted in the Table2
    with a time difference of 2 seconds or so(very short span, hence programmatic check fails).
    We are unable handle this case using programmatic check of records in table.
    Cany any one suggest the best solution possible to tackle this scenario.
    Thanks,
    Sanjaykar

    sanjaykar,
    Unless you use locking on the "sequence number generator" table, you WILL at some time get duplicates when two people try to insert at nearly the same time. Sounds like you are going for the infamous "gap-free sequence." My honest and not sarcastic nor facetious suggestion would be to go with a sequence number and abandon your approach.
    However, if you insist, you can do this by locking the row in the sequence generator table. You can do this in Oracle by using the FOR UPDATE clause of the SELECT statement like this:
    select current_value
    from my_sequence_table
    where sequence_name = 'foobar'
    FOR UPDATEThat will lock the row. You can then increment the number, specify it as your key value, update the current_value in your sequence table and commit. If another user jumps in around the same time, the SELECT FOR UPDATE will block, as the row is already locked. However, I cannot stress enough that if you are looking for a high-performance application, one that lets more than one person work at the same time, this is a horrible idea. Just pop over to http://asktom.oracle.com and search for gap-free sequences to read plenty of long discussions why.
    Best,
    John

  • How to find gaps in data?

    Hi!
    I have the following problem.
    Data:
    range_id actual_nr
    AAA 001AAA
    AAA 002AAA
    AAA 003AAA
    AAA 006AAA
    AAA 007AAA
    AAA 009AAA
    BBB 001BBB
    BBB 002BBB
    etc.
    I have to get report in the following form
    from to nr_of_rows
    001AAA 003AAA 3
    006AAA 007AAA 2
    009AAA 1
    001BBB 002BBB 2
    etc.
    As you can see if there is a gap in sequence then I have to calculate how many rows were in sequence before the gap.
    Can somebody give me some hints or even working statement?

    How's this?
    WITH
         Sample_Data
    AS
          SELECT 'AAA' range_id, '001AAA' actual_nr FROM Dual UNION ALL
          SELECT 'AAA' range_id, '002AAA' actual_nr FROM Dual UNION ALL
          SELECT 'AAA' range_id, '003AAA' actual_nr FROM Dual UNION ALL
          SELECT 'AAA' range_id, '006AAA' actual_nr FROM Dual UNION ALL
          SELECT 'AAA' range_id, '007AAA' actual_nr FROM Dual UNION ALL
          SELECT 'AAA' range_id, '009AAA' actual_nr FROM Dual UNION ALL
          SELECT 'BBB' range_id, '001BBB' actual_nr FROM Dual UNION ALL
          SELECT 'BBB' range_id, '002BBB' actual_nr FROM Dual
    SELECT
         MIN(actual_nr_start)     actual_nr_start,
         actual_nr_finish,
         MAX(Total)
    FROM
          SELECT
              range_id,
              MIN(actual_nr)     actual_nr_start,
              MAX(actual_nr)     actual_nr_finish,
              MAX(Level)     Total
          FROM
              Sample_Data
          CONNECT BY
              range_id          = PRIOR range_id
             AND     substr(actual_nr, 1, 3)     = substr(PRIOR actual_nr, 1, 3) + 1
          GROUP BY
              range_id,
              CONNECT_BY_ROOT actual_nr
    GROUP BY
         actual_nr_finish
    ORDER BY
         SubStr(actual_nr_start, -3),
         actual_nr_start;Message was edited by:
    Brian Tkatch 2
    consolidated two levels.

  • How to pin sequences in the shared pool for RAC?

    We have a RAC environment with two instances. I want to pin some sequences in the shared pool to boost the performance. Do I need to pin them in both of the instances or just pin them in one instance?
    Thanks in advance

    If you cannot tolerate gaps, you must not use sequences. Period. A sequence-generated key will have gaps because transactions roll back, because databases get shut down, etc. If you want to ensure that there are no gaps, you have to write code that serializes access to a resource (i.e. a custom table of sequences) over the full length of a transaction. Of course, this is hugely inefficient and kills the application's scalability, but it does prevent gaps. Sequences are much faster and much more scalable, but they do not and can not guarantee that there are no gaps.
    Assuming the intention is to minimize gaps, rather than to eliminate them, NOCACHE & ORDER can help. That means, though, that you may need to communicate with the other nodes in the cluster every time you need a new value from the sequence, which is the slow part. Pinning the sequence is not going to be beneficial.
    Justin

  • Cannot delete gap in sequece

    HI
    I'm hoping someone can help. Whenever I make a cut and try to close the gap, I'm unable. I've done this numerous times before with no issues. Usually, I select the clip, delete it and then select the gap and delete the space in between. I've also used the shift+delete option to close the gap. Neither one is working for me. Any suggestions on what could be the prob?
    Thank you!!
    Delete gaps between clips
    When you delete space between clips in a Timeline, all clips in all unlocked tracks shift according to the duration of the gap. To prevent a track from shifting during a ripple delete (or any insert or extract edit), lock the track. Alternatively, turn off Sync Lock on those tracks that you don't want to shift.
    In a Timeline, do one of the following: 
    Right-click (Windows) or Ctrl-click (Mac OS) the gap between two clips, and choose Ripple Delete.
    Select the gap between two clips, and choose Edit > Ripple Delete.
    Select the gap between two clips, and press Delete.
    To find more gaps in the sequence, see Find gaps in sequences and tracks.

    Thanks you both for the help. For whatever reason, it started working properly today. It's tough being a newbie!
    Thanks again!

  • Sequence value missing

    Hello Gurus,
    I'm loading data from staging table to target and need to generate sequence while loading target. Using below tables.
    Table 1 SRC (staging table) Table 2 : TGT ( target table)
    ID name Sal           Seq ID name Sal
    10 ‘abc’ 200 1 10 ‘abc’ 200
    20 ‘sdf’ 300
    30 'ghr' 400
    40 'ghk' 500
    My query is :
    select t.ID,t.name,t.sal,decode(t.seq,0,SEQUENCE.nextval,1,NULL) as seq
    from
    (select src.ID ,src.name ,src.sal ,decode(tgt.seq,NULL,0,1) seq
    from SRC
    left outer join TGT
    on src.id = tgt.id ) t
    1st RUN :
    ID name Sal seq
    10 ‘abc’ 200 NULL
    20 ‘sdf’ 300 1
    30 'ghr' 400 2
    40 'ghk' 500 *3*
    2nd RUN :
    ID name Sal seq
    10 ‘abc’ 200 NULL
    20 ‘sdf’ 300 *5*
    30 'ghr' 400 6
    40 'ghk' 500 7
    Every time i execute the same query there is gap in sequence ( after 3 , 4 is missing. ).
    Please let me know what im missing here.
    or how to avoid the gap in sequence.
    Using Oracle 10g Release 10.2.0.1.0
    Thanks !

    My query is :
    select t.ID,t.name,t.sal,decode(t.seq,0,SEQUENCE.nextval,1,NULL) as seq
    from
    (select src.ID ,src.name ,src.sal ,decode(tgt.seq,NULL,0,1) seq
    from SRC
    left outer join TGT
    on src.id = tgt.id ) tTake a look...
    DECODE (t.seq,  0, SEQUENCE.NEXTVAL,  1, NULL)When it executes, whenever t.seq is 0 or 1, SEQUENCE.NEXTVAL executes and sequene is incrementing...
    SQL> select test_seq.nextval from dual;
       NEXTVAL
             1
    SQL> select decode(1,1,test_seq.nextval,2,2) from dual;
    DECODE(1,1,TEST_SEQ.NEXTVAL,2,2)
                                   2
    SQL> select decode(1,1,test_seq.nextval,2,2) from dual;
    DECODE(1,1,TEST_SEQ.NEXTVAL,2,2)
                                   3
    SQL> select decode(1,1,test_seq.nextval,2,2) from dual;
    DECODE(1,1,TEST_SEQ.NEXTVAL,2,2)
                                   4
    SQL> select decode(2,1,test_seq.nextval,2,2) from dual;
    DECODE(2,1,TEST_SEQ.NEXTVAL,2,2)
                                   2
    SQL> select decode(2,1,test_seq.nextval,2,2) from dual;
    DECODE(2,1,TEST_SEQ.NEXTVAL,2,2)
                                   2
    SQL> select decode(1,1,test_seq.nextval,2,2) from dual;
    DECODE(1,1,TEST_SEQ.NEXTVAL,2,2)
                                   7

  • How to auto generate a sequence.

    Dear all
    The entity Object "OrderEntryEO" has an attribute called"OrdNumber" that indicates the reference number of the order number. the order number is compose be a sequence on the year. For example 1/2011 , 2/2011 , 3/2011 and so on..
    this sequence must be auto generated when pressing save button.
    I have generated the entityImpl java class "OrderEntryEOImpl.java . with accessors , DO_DML method and create method.
    these are the methods
    {code}
    protected void create(AttributeList attributeList) {
    super.create(attributeList);
    {code}
    {code}
    protected void doDML(int operation, TransactionEvent e) {
    super.doDML(operation, e);
    {code}
    Can any one please help me how to Implement this in java code
    Regards

    I wanted to clear up what I consider to be some misinformation on this thread.
    Database sequences, regardless of what magic you try (including setting the cache size to 1) can and will, by their very design have gaps. I don't care if you are doing a web app, a client server app, an SOA app, or any other newfangled or old-fashioned, red screens, green screens, blue screens - DATABASE SEQUENCES IN ORACLE CAN AND WILL HAVE GAPS.
    There is only one way to ensure gap-free sequence numbers upon insert:
    * You must lock the table or use some other device to serialise inserts.
    Any other technique you want to use will not work in a multi-user environment. I'm not going to go through the proof of it here because it's been discussed ad-infinitum (search on asktom.oracle.com if you want to see all of the crazy failed attempts to do it without serialisation). You can also read on asktom about some other techniques (such as assigning the numbers after the fact) that you could consider.
    Bottom line to remember however, Oracle Database Sequences are not and cannot be gap free (at least as of today, the 4th of April, 2011 AD at 08:48 GMT +1)
    John

  • Sequence in Transaction

    Hi I want to put a sequense in transaction. Meaning that if I roll back the transaction I want the value of the sequence also to roll back. Is that possible?
    Regards,
    Sovon.

    No.
    If you're trying to create a gap-free sequence, you're not going to be able to do it. Aside from being unable to rollback a sequence increment, there are a number of other problems that will eventually cause you problems.
    Justin

Maybe you are looking for

  • HDMI sound. Pavilion DV6. Windows 7. TV sound was working via HDMI. Now switched off?

    I connected the pavilion dv6 to the tv with an HDMI cable. Sound and vision were working on the tv after setting the TV to HDMI. My Grandson discovered that their was no sound from the computer and, unknown to me, changed something to get sound from

  • 13" MacBook Pro - Where to store the remote?

    Well, On my old black MacBook, there were magnets around the top frame around the screen and when I was at my desk, I would store my Apple Remote on the top corner of my screen. It was great because it would just "stick" there. On the new 13" MacBook

  • Update field taking value from previous row

    I have a table TEST (ID int, name varchar(20), amount decimal(18,0)). First row of the table have correct value. I want to update amount column except first row by adding 10 with the previous row value without using cursor. id    Name    Amount 1    

  • Copying from report output to a module pool screen

    Hi to all experts My requirement is to call a transaction when i click a button in module pool programme .when i execute that transaction an alv report is displayed and user selects some records that should be copied over to the module pool screen.

  • System date issue

    Hi I have a java file which is reading data from datafile and insert into database. Now issue is upto 30 september(system date) program is working as expected. But after 30sept when system date chaned to 1st or second oct its not workin at all any id