Sequence numbers and triggers

We want to insert rows into a target table. The target table would have a sequence number that is populated on insert.
We want to create a "Before Insert" trigger that would check a table on a second instance across a DBLink. The trigger would check the natural key.
If the natural key exists, then a previously assigned surrogate ID would be used on the inserted row instead of the sequence number and the sequence number would not be incremented or used. If the natural key does not exist, then the sequence number would be incremented and used.
The question I have is: When is the sequence number resolved? Can we override the sequence number as outlined?

hi robert,
this is the OracleAS Portal Content Management forum. Please post your question in the Database forum
General Database Discussions
thanks,
christian

Similar Messages

  • Finding missed sequence numbers and rows from a fact table

    Finding missed sequence numbers and rows from a fact table
    Hi
    I am working on an OLAP date cube with the following schema:
    As you can see there is a fact transaction with two dimensions called cardNumber and Sequence. Card dimension contains about three million card numbers. 
    Sequence dimension contains a sequence number from 0 to 255. Fact transaction contains about 400 million transactions of those cards.
    Each transaction has a sequence number in 0 to 255 ranges. If sequence number of transactions of a card reaches to 255 the next transaction would get 0 as a sequence number.
    For example if a card has 1000 transactions then sequence numbers are as follows;
    Transaction 1 to transaction 256 with sequences from 0 to 255
    Transaction 257 to transaction 512 with sequences from 0 to 255
    Transaction 513 to transaction 768 with sequences from 0 to 255
    Transaction 769 to transaction 1000 with sequences from 0 to 231
    The problem is that:
    Sometimes there are several missed transactions. For example instead of sequence from 0 to 255, sequences are from 0 to 150 and then from 160 to 255. Here 10 transactions have been missed.
    How can I find all missed transactions of all cards with a MDX QUERY?
    I really appreciate for helps

    Thank you Liao
    I need to find missed numbers, In this scenario I want the query to tell the missed numbers are: 151,152,153,154,155,156,157,158,159
    Relative transactions are also missed, so I think it is impossible to get them by your MDX query
    Suppose this:
    date
    time
    sequence
    20140701
    23:22:00
    149
    20140701
    23:44:00
    150
    20140702
    8:30:00
    160
    20140702
    9:30:00
    161
    20140702
    11:30:00
    162
    20140702
    11:45:00
    163
    As you can see the sequence number of the last transaction at the 20140701 is 150
    We expecting that the first transaction of the next day should be 151 but it is 160. Those 10 transactions are totally missed and we just need to
    find missed sequence numbers

  • Sequence Names And Triggers

    I am trying to link my sequences with my triggers. I have looked in sys.obj$, sys.seq$ and sys.trigger$ but the obj# doesn't match in triggers and seq$.
    What I am trying to do is write a script that will update the sequences to the max vaule in a table. I have 125+ seqences and do it by hand will not work. I can get the max value but then I need to create or replace the sequence with the new one I don't just want to updated it.

    Have you looked at dependencies$ or the dba_dependencies view? It should provide information about the trigger dependencies including the sequences.
    Hope this helps.
    Janet.

  • Sequence of Events Fired and Triggers Fired in Forms.

    Hi,
    Please help me to know how the events and Triggers will be fired in Forms Developer 9i.
    Thanks in Advance.

    Please take a look into Forms-Builder Online Help, there you'll find some sequence diagrams describing the order of Triggers firing on certain actions.
    e.g. search for "Post and Commit Transactions"
    brds,
    Peter

  • ACL and sequence numbers

    I had the first two lines in the access list and all was well, I then added the 3rd. From what I need to put the 3rd entry (deny host 10.1.30.51) after the second entry and before the permit any. Even though I created sequence numbers in order of the 3 entries (10,20,30) the sequence numbers didnt put them in order and they dont even show up in the show run. What went wrong? How is it possible to edit an acl without sequence numbers also?
    Cause if I had:
    10 deny x.x.x.x
    20 deny x.x.x.x
    30 permit any
    Then I could add say 15 deny x.x.x.x, but now I cant and I dont even know what happened to the sequence numbers when I created them.
    Thanks.
    Standard IP access list 1
        deny host 10.1.30.50 (4 match(es))
        permit any (8 match(es))
        deny host 10.1.30.51
    Router#

    Hi Milan,
    Sequence numbers are indeed not supported if you define a numbered access list. With both standard and extended numbered ACLs, however, it is possible to do a trick: if you refer to them as named ACLs (use their number as their name), you actually are able to use the sequence numbers.
    For example:
    R1(config)# do show run | i access-listaccess-list 1 deny   192.0.2.1access-list 1 permit anyaccess-list 100 deny   ip host 192.0.2.1 anyaccess-list 100 permit ip any anyR1(config)# do show ip access-lStandard IP access list 1    10 deny   192.0.2.1    20 permit anyExtended IP access list 100    10 deny ip host 192.0.2.1 any    20 permit ip any anyR1(config)# ip access-list standard 1R1(config-std-nacl)# 15 deny 192.0.2.15R1(config-std-nacl)# exitR1(config)# do show access-listStandard IP access list 1    10 deny   192.0.2.1    15 deny   192.0.2.15    20 permit anyExtended IP access list 100    10 deny ip host 192.0.2.1 any    20 permit ip any anyR1(config)# ip access-list extended 100R1(config-ext-nacl)# 15 deny ip host 192.0.2.15 anyR1(config-ext-nacl)# exitR1(config)# do show access-lStandard IP access list 1    10 deny   192.0.2.1    15 deny   192.0.2.15    20 permit anyExtended IP access list 100    10 deny ip host 192.0.2.1 any    15 deny ip host 192.0.2.15 any    20 permit ip any any
    The router is even smart enough to disallow to refer to a named ACL whose name is a number of the opposite type than stated on the command line:
    R1(config)# ip access-list standard 101% % Invalid access list name.R1(config)# ip access-list extended 2% % Invalid access list name.
    What Collin may have in mind, though, is that host entries in standard ACLs are reorganized to a different order than entered:
    R1(config)# ip access-list standard TestR1(config-std-nacl)# permit 10.0.0.1R1(config-std-nacl)# deny 10.0.0.2R1(config-std-nacl)# permit 10.0.0.3R1(config-std-nacl)# deny 10.0.0.4R1(config-std-nacl)# permit 10.0.0.5R1(config-std-nacl)# deny 10.0.0.6R1(config-std-nacl)# permit 10.0.0.7R1(config-std-nacl)# deny 10.0.0.8R1(config-std-nacl)# permit anyR1(config-std-nacl)#exitR1(config)# do show access-list TestStandard IP access list Test    80 deny   10.0.0.8    20 deny   10.0.0.2    30 permit 10.0.0.3    10 permit 10.0.0.1    60 deny   10.0.0.6    70 permit 10.0.0.7    40 deny   10.0.0.4    50 permit 10.0.0.5    90 permit anyR1(config)# do show run | section Testip access-list standard Test deny   10.0.0.8 deny   10.0.0.2 permit 10.0.0.3 permit 10.0.0.1 deny   10.0.0.6 permit 10.0.0.7 deny   10.0.0.4 permit 10.0.0.5 permit any
    This reordering happens only with standard ACLs and is a result of indexing the host entries in the ACL into a hash table (the hash function being XOR of individual octets of the IP address in the host entry) for faster access. When printing out the ACL, first the host items are printed out in the order they are stored in the hashing table, and only then the remaining entries that use wildcards. Wildcard entries are not reordered.
    The funny thing is that the ACL is actually even stored in the configuration in the reordered form, and thus evaluated in a reordered form, which can be confusing. However, you may have noticed that the router will prohibit you from entering a host ACL after entering a wildcard ACL that also matches the IP address in a wildcard entry:
    R1(config)# ip access-list standard Test2R1(config-std-nacl)# permit 10.0.1.0 0.0.0.255R1(config-std-nacl)# deny 10.0.1.1% Access rule can't be configured at higher sequence num as it is part of the existing rule at sequence num 10R1(config-std-nacl)#
    Why is this? Obviously, a host entry can  either select the same action for a packet that would be taken by a more  general wildcard entry (in which case it is not necessary for the  host entry to be entered at all), or  it can override the action that would be chosen by a more general  wildcard entry. In this second case, it is necessary for this host entry  to be placed in the ACL first, otherwise it would never be reached. Ordering of host entries themselves can be arbitrary, as they do not influence each other.  This leads us to a general logic in standard ACLs - it is required to put  all host entries first, and wildcard entries last. Now it is completely logical to visit all host entries first (indexed by a hash for rapid access), and then visit the wildcard entries.
    Quite a long post... sorry for that. Hopefully, we've resolved some of the doubts.
    Best regards,
    Peter

  • Tethering and Controlling the Shooting Sequence Numbers

    This may be a bit much - but I have to ask.
    I'm just getting started with Aperture, but one of my reasons for switching from Lightroom was the Tethering abilities of Aperture.
    My question is very simple, when shooting tethered where/how can I control the image sequence numbers? The sequence number on my EOS 5D is controlled by the folder it's writing too, and the EOS software lets you specify a starting number- however ...
    Aperture is not using the EOS Utility to do the tethering, or is it?
    Anyway- if someone can tell me how to control my sequence starting point while shooting tethered, that'd be cool --
    thanks-

    When I upload photos to My Photo Steam the sequence of the photos is altered.  So any shots taken in 'burst' mode will not appear in order - usually the middle shots of the burst sequence are moved to either the beginiing or the end of the seqence.  (so, for example, when reviewing a sequence in My Photo Stream - you see a basketball player take a shot before he dribbles towards the basket...)
    I wonder, why you are seeing more than one photo of a burst of photos in the PhotoStream at all. According to the "Photo Stream FAQ" only the final selected photo of a burst will upload to the Photo Stream, see:
    http://support.apple.com/kb/HT4486
    Are all of the photos taken with burst mode or image stabilization on my iPhone 5s saved to My Photo Stream?
    No. Only the final photos that you select when using burst mode, and only the final composite image shot with image stabilization are added to My Photo Stream.

  • Assigning sequence numbers treo cords

    Please help to understand the following, because it's a little unclear for me.. can you provide me an example?
    So, regarding to assigning sequence numbers when a new record is created, we usually use a pre-insert trigger, with this code:
    SELECT orders_seq.NEXTVAL
    INTO :orders.order_id
    FROM SYS.dual;
    But:
    You can also assign sequence numbers from a table. If you use this method, two transactional
    triggers are usually involved:
    • Use Pre-Insert to select the next available number from the sequence table (locking the row
    to prevent other users from selecting the same value), assign it to the Forms item, and
    increment the value in the sequence table by the required amount.
    • Use Post-Insert to update the sequence table, recording the new upper value for the
    sequence.So how to assign a sequence number from a ... table?
    Thanks

    You have to implement the number generator yourself; something similar to this: http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:4343369880986
    cheers

  • Function and triggers and procedures

    sorry to asking this question,
    In oracle. we use the function and triggers and procedure.
    for eg:
    if we wrote an trigger for a table. it fires at a time manipulating table. (database contains table contains datas and database also contains triggers likewise function,procedure).
    but my questions?: is
    In my database I kept only tables. no triggers,no function,no procedures. and
    i dont want to kept this triggers, function, procedures in database  Instead of i want to kept this triggers, function, procedures in business logic layers(middle tier)
    is it possible? .
    if yes means, how to write or where to write? please help me, or else send the guidance documents or blog releated to it.

    Subu123,
    the +1 related to Would be great if you can take step back and see the implementation from another angle. First see why do you need DB trigger/function etc.Then check whether it is possible to implement the functionality using ADF BC + feasibility study between 2 approaches(I didn't mean to invoke DB objects from business components, instead checking the feasibility of implement the same functionality in your EntityObj/ViewObj/Service calls )Before making a decision for or against holding fuctions, triggers and procedures in the DB, you have to get the whole picture.
    Think about a trigger outside the DB. What could this be and why or for what is it used?
    All the answers are pointing to 'lets keep them in the DB'. Now there are situation where you don't have a DB or are not allows to use it. Still there can be triggers, only they are implemented in a different way.
    The same can be said for procedures and functions.
    So you have to think about the whole problem and how each sub problem you have to solve work together to resolve the whole problem.
    I'm personally tend to keep the business logic the the DB if the business logic is already there (e.g. I have to migrate an old forms app).
    If I design a new app I tend to keep the logic in java. Only sequences (for generating ids) and some other stuff which is purely db related like cleaning up tables I keep in the DB.
    Timo

  • Need help in user privilage and triggers

    hi,
    i need to create general users who can insert a row into a table but should not be able to delete any data, so which minimuim privilages i should assign.
    grant connect session and grant resource or anything else?
    and one more prob in triggers, i have written a trigger to trigger if expamt exceeds eclimit. i am gettin errors
    create or replace
    TRIGGER TR_EXCEEDLIMIT
    AFTER INSERT OR UPDATE OF EXPAMT ON EXPENSEITEM
    FOR EACH ROW
    DECLARE
    V_ECLIMIT EXPCAT.ECLIMIT%TYPE%;
    BEGIN
    SELECT ECLIMIT INTO V_ECLIMIT FROM EXPCAT
    WHERE ECNO = :NEW.ECNO;
    IF(:NEW.EXPAMT > V_ECLIMIT) THEN
    INSERT INTO LOG_TABLE (excno, exctrigger, exctable, exckeyvalue, excdate, exctext) VALUES (LOG_SEQ.NEXTVAL, 'TR_EXCEEDLIMIT', 'EXPENSEITEM', :NEW.EINO, SYSTEMSTAMP, ('INSERTED OR UPDATED DATA OF EXPAMT EXCEEDS THE VALUE IN ECLIMIT');
    ENDIF;
    END TR_EXCEEDLIMIT;
    errors
    Error(7,30): PLS-00103: Encountered the symbol "%" when expecting one of the following: := ( ; not null range default character The symbol "%" was ignored.
    Error(12,235): PLS-00103: Encountered the symbol ";" when expecting one of the following: ) , * & | = - + < / > at in is mod remainder not rem => .. <an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_ LIKE4_ LIKEC_ between overlaps || multiset year DAY_ member SUBMULTISET_ The symbol ")" was substituted for ";" to continue.
    Error(14,5): PLS-00103: Encountered the symbol "TR_EXCEEDLIMIT" when expecting one of the following: if

    You don't need to select the (sys)timestamp from dual, you can directly assign it:
    create or replace trigger tr_exceedlimit
    after insert or update of expamt on expenseitem
    for each row
    declare
    v_eclimit   expcat.eclimit%type;
    v_timestamp timestamp := systimestamp; -- or localtimestamp
    begin
    select eclimit into v_eclimit from expcat where ecno = :new.ecno;
    if (:new.expamt > v_eclimit) then
      insert into log_table
       (excno, exctrigger, exctable, exckeyvalue, excdate, exctext)
      values
       (log_seq.nextval,
        'TR_EXCEEDLIMIT',
        'EXPENSEITEM',
        :new.eino,
        v_timestamp,
        'INSERTED OR UPDATED DATA OF EXPAMT EXCEEDS THE VALUE IN ECLIMIT'
      dbms_output.put_line('ERROR: EXAMT EXCEEDS ECLIMIT');
    end if;
    end tr_exceedlimit;You cannot use timestamp, but you can use localtimestamp or systimestamp.
    See the Oracle Docs @ http://tahiti.oracle.com for more details on them (and triggers).
    Also:
    Error(15,5): PL/SQL: ORA-02289: sequence does not existCheck your LOG_SEQ sequence, does it exist and are privileges set correctly?
    Edited by: hoek on Jan 26, 2010 8:20 AM typo in link

  • LR3 Web Gallery Sequence Numbering bug?

    Anyone else getting this problem with sequence numbering in the web HTML templates? Basically, as you jump through photos the photo number is always stuck on #1, never changes when you go to the next photo - should go 1, 2, 3, 4, 5...
    I just sent a bug report but, wondering if anyone else found a fix for this yet.
    This is in LR3 on Mac - really trying to do this on TTG Highslide gallery but, same problem occurs in default Lightroom HTML gallery.
    Thanks.
    ******BUG******
    Concise problem statement:
    Steps to reproduce bug:
    1. Go to Web Module
    2. Choose default HTML Gallery
    3. Under Image Info set Caption to Sequence
    Results:
    Sequence caption always shows 1/total images.
    i.e. 1/10,  1/10,  1/10,  1/10
    Expected results:
    Sequence should increment current image number / total images as you click through images.
    i.e. 1/10, 2/10, 3/10, 4/10

    Yeah, still have the numbering problem using the Image Info sequence outputs.
    But, if you use the standard Lightroom Flash Gallery it has it's own sequence numbering output (that does not use Image Info captions)  and it does work correctly. These show up as 1/9, 2/9, 3/9 etc. on each photo down by the back/next buttons.
    Also, the Cell Numbering does work when using the Lightroom HTML Gallery - though, those numbers only appear on the index page not on individual photos.
    But, haven't seen a good work-around yet for sequence numbering in Image Info area. Only option there seems to be typing numbers manually into the caption. Or, if you need the caption for other info maybe use one of the IPTC fields like Headline to type in your numbers. You can then do a Custom Setting in web module to have those text fields show up with your photos.
    Really hoping we will see a LR 3.1 sometime soon with a fix - should be an easy correction for Adobe.

  • Sequence numbers not generated sequentially?

    Our situation: We have encountered an issue with our database, where it appears that a sequence has generated a number out of sequence, that is, to fill in a gap left previously. That is, in the affected table, we have records like:
    Seq No Date (DD/MM/YY)
    1 29/12/08
    2 29/12/08
    3 4/1/09
    4 29/12/08
    The code that actually updates the database is from a third party, so I am unable to prove the following, but the vendor assures me that:
    1. The sequence numbers are generated using "select message_number.nextval from dual".
    2. The Date column is not modified after the record is created. ( Nor is it supposed to be )
    The sequence is created by "CREATE SEQUENCE MESSAGE_NUMBER START WITH 10000000 INCREMENT BY 1 MINVALUE 10000000 CACHE 20 NOCYCLE NOORDER"
    This was detected only yesterday, after the event, and is very uncommon ( I have not found another instance, but there are over 7,000,000 records, so I haven't performed an exhaustive search). We are relying on the sequence numbers always being generated sequentially, as in each message_number.nextval is greater than the previous one.
    I don't think that the date change was due to a user accidentaly changing the date. Related records to '3' are also dated 4/1/09, there is no facility for a user to change the date outside of accessing the database directly, and even the developers do not have write access to this database.
    My questions:
    1. Is this normal behaviour for a sequence? To go back and fill in a gap like this? If so we'll have to change one of the assumptions of one of our modules.
    2. Should the sequence be defined with 'ORDER' rather than 'NOORDER' to stop this?
    3. Could this be a bug in the sequence number generation? We are using Oracle 9.2.0.1.0.
    4. Is this situation "impossible", and therefore there is a bug in the vendor library that we need to track down.
    Thanks for your help,
    Wayne.

    wayneb wrote:
    Our situation: We have encountered an issue with our database, where it appears that a sequence has generated a number out of sequence, that is, to fill in a gap left previously. That is, in the affected table, we have records like:
    Seq No Date (DD/MM/YY)
    1 29/12/08
    2 29/12/08
    3 4/1/09
    4 29/12/08
    The code that actually updates the database is from a third party, so I am unable to prove the following, but the vendor assures me that:
    1. The sequence numbers are generated using "select message_number.nextval from dual".
    2. The Date column is not modified after the record is created. ( Nor is it supposed to be )There might be a delay between fetching the sequence and storing the sysdate? value in the database.
    maybe some user prepared a new record. Then went to some new years eve party and when he came back at the begining of next year he commited the data (record send to database, database is adding date column by some trigger...).
    >
    The sequence is created by "CREATE SEQUENCE MESSAGE_NUMBER START WITH 10000000 INCREMENT BY 1 MINVALUE 10000000 CACHE 20 NOCYCLE NOORDER"
    This was detected only yesterday, after the event, and is very uncommon ( I have not found another instance, but there are over 7,000,000 records, so I haven't performed an exhaustive search). We are relying on the sequence numbers always being generated sequentially, as in each message_number.nextval is greater than the previous one.
    I don't think that the date change was due to a user accidentaly changing the date. Related records to '3' are also dated 4/1/09, there is no facility for a user to change the date outside of accessing the database directly, and even the developers do not have write access to this database.
    My questions:
    1. Is this normal behaviour for a sequence? To go back and fill in a gap like this? If so we'll have to change one of the assumptions of one of our modules.No sequences don't fill gaps. However it is possible to fetch and cache values from a sequence for later usage. Especially in a RAC environment you can get sequence values that are not in order of time.
    2. Should the sequence be defined with 'ORDER' rather than 'NOORDER' to stop this?No.
    3. Could this be a bug in the sequence number generation? We are using Oracle 9.2.0.1.0.Extremly unlikely, but you can always check Metalink.
    4. Is this situation "impossible", and therefore there is a bug in the vendor library that we need to track down.You can create such situations programatically. Whether it is a bug depends on the specifications for the software.
    >
    Thanks for your help,
    Wayne.Edited by: Sven W. on Mar 24, 2009 5:00 PM

  • Page item sequence numbers

    Maybe this one is for a future improvement...
    After reordering page items using the drag and drop feature the items all have a sequence number one greater than it's predecessor.
    This makes it hard to put a new item in between existing ones. Generating sequence numbers 5 or 10 apart would make this a bit easier.

    hi,
    i dont know whether you have tried this before...
    10
    10.1
    10.2
    10.3
    20
    20.1
    20.2
    30
    this is acceptable in apex item sequence number for inserting new items .
    Thanks
    Mark Wyatt
    Edited by: Websoft on Sep 30, 2009 6:33 AM

  • How to read sequence numbers from RTP packets

    hi everyone.
    i want to know how to read sequence numbers of RTP packets. I will need that to reconstruct my stream from packet losses.
    URGENT Help needed!!

    The StreamTokenizer parses all numbers into only one type of value, a double. If you know that all the numeric values in the file will be integers, you could just cast the nval double field to an int and the toString() method will format it correctly.
    If you want to have different tokens and value types for different kinds of numbers, you will have to sub-class StreamTokenizer and add these capabilities yourself. You can add the type constant TT_INT, and provide an int field named ival. The toString() method would then format the value in the correct manner.
    If, on the other hand, you are actually looking for the exact text that was parsed, you could add code that collects the characters as they are parsed for any token type into the sval field in the nextToken() method, just like it already does when the token is a TT_WORD. In this manner sval is always valid for any token type.
    I hope you find this of some help.

  • Sequence numbers - with no gaps!

    I seek some advice from anyone with first hand experience in this area.
    My need is simple; generate a new ID number for every order for use as the primary key.
    Obviously this simple exercise could be a bottleneck as volumes ramp up, so I was pleased to find the Oracle feature to generate such numbers (efficiently presumably). However, upon closer reading it was apparent that aborted transactions would result in the loss of the number allocated to to that order if another transaction had obtained the next sequence number already (as one would want it to, rather than serializing transactions).
    I don't want to have gaps in the sequence as the system needs a high degree of auditability. I am thinking of utilising the Autonomous Transaction feature to write the newly acquired sequence number to the order file with a flag indicating that the record is incomplete, and that record is to be skipped by normal system applications (but available to audit reports which will interpret the reason correctly), then returning to the far more extensive main transaction which updates many tables.
    The other alternative is to control sequence numbers within the application itself, or try to get the sequence number as the very last step before writing the new order record, but this probably won't guarantee gapless reliability either. The ID itself has no significance, and it doesn't matter if an ID was used out of strict date/time sequence, so I really don't want to execute these updates serially.
    So, my question is this:
    a) do most people use the builtin sequence number feature?
    b) if so, is there a standard technique for avoiding or accounting for gaps?
    c) if the application must take over this task, should the counter for the last used ID be in a single row table to minimise bottlenecks caused by the thisrecord being locked? There will be several such counters for different aspects of the application, and i thought of having each in its own row in a small table, but I'm concerned about the whole table getting locked and freezing out otherwise-unrelated updates.
    Thanks for any advice you may have.
    CS

    user8821725 wrote:
    I seek some advice from anyone with first hand experience in this area.
    My need is simple; generate a new ID number for every order for use as the primary key.
    Obviously this simple exercise could be a bottleneck as volumes ramp up, so I was pleased to find the Oracle feature to generate such numbers (efficiently presumably). However, upon closer reading it was apparent that aborted transactions would result in the loss of the number allocated to to that order if another transaction had obtained the next sequence number already (as one would want it to, rather than serializing transactions).
    I don't want to have gaps in the sequence as the system needs a high degree of auditability. One of the very very few reasons for me to have a requirement for "gapless" sequences is if you have a kind of checking mechanism outside of the database that is implemented using this gapless number. I had such a requirement once, when exchanging files with another bank where we had to ensure that each file was transferred correctly and in the right order. Your "high degree of auditability" might be a similiar requirement. Just remember as long as you are still inside the database you can use other mechanisms to increase auditability.
    I am thinking of utilising the Autonomous Transaction feature to write the newly acquired sequence number to the order file with a flag indicating that the record is incomplete, and that record is to be skipped by normal system applications (but available to audit reports which will interpret the reason correctly), then returning to the far more extensive main transaction which updates many tables.Hm. I don't see why you want to use Autonomous Transactions for this. It might be useful to lessen locking conflicts , depending how your future sequence mechanism will be built.
    >
    The other alternative is to control sequence numbers within the application itself, or try to get the sequence number as the very last step before writing the new order record, but this probably won't guarantee gapless reliability either. The ID itself has no significance, and it doesn't matter if an ID was used out of strict date/time sequence, so I really don't want to execute these updates serially.I would go for generating the sequence as the very last step. It needs to be set to NOCACHE of cause. This will garantee that the sequence fetched from mySeq.nextval is gapless. The problem is then in your application. Your application must be built in a way that it ensures to use this sequence, or at least to create a noticable alert when this generated sequence can't be used anymore. In essence this means. Each unhandled (database) error that happens after you fetched the next sequence value must be raised in a way that informs all relevant people about this error.
    Example: It might be that you use the sequence to write an order file. What happens if halfway through writing the file your disk runs out of space? This can be such an issue where a sequenced value will be lost. Your organisation must take care of those things.
    >
    So, my question is this:
    a) do most people use the builtin sequence number feature?Yes. But for some tasks a sequence is not the best way, for example if you want a numbering for each item of your order. This "sequence" needs to restart with every new order.
    b) if so, is there a standard technique for avoiding or accounting for gaps?NOCACHE => Avoids gaps during generation
    Database Trigger => Tries to use the sequence as late as possible
    c) if the application must take over this task, should the counter for the last used ID be in a single row table to minimise bottlenecks caused by the thisrecord being locked? There will be several such counters for different aspects of the application, and i thought of having each in its own row in a small table, but I'm concerned about the whole table getting locked and freezing out otherwise-unrelated updates.This is a possibility and the issues you describe are why we avoid such a solution in general. Autonomous transactions help to reduce the locking conflict, but they increase the chance that you produce gaps.
    >
    Thanks for any advice you may have.
    CSOracle can guarantee to produce gapless sequences. But it can't guarantee that your application uses such a sequence in a gapless way.

  • 70D changed sequence numbers from 6.. to 5...

    Month old 70D was issuing sequnce numbers OK in August 31  in the 600 range but on September 2  (the next time I used the camera) the sequence numbers changed to 5000. I manually changed the date to October but the sequence numbers remained in the 5000 range so it probably had nothing to do with the month change. I did a menu RESET,  took a photo and it was just the next number (5102) so no help there. In both cases there is a number 100 and a dash preceding the sequence number. Any suggestions? Thanks 
    BTW the camera FILE NUMBERING setting is CONTINUOUS
    Solved!
    Go to Solution.

    Hello bob70D,
    The most likely culprit with something like this is going to be the card.  It is very likely that the camera is reading an old file numbering scheme (could even be from another Canon EOS DSLR) and "picking up" where the numbers leave off. 
    To test this, and really to resolve this issue, you'd need to format the card.  Only do this in the camera and only once you've backed up your pictures.  First, set the camera's file numbering to Manual Reset and then Format.  It will bring everything back to 0001.  Then go back into the Menu and back to file numbering and choose Continuous this time. 
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

Maybe you are looking for

  • Sending Data to PDF Forms from ABAP Program.

    Hi Experts, I left ABAP Programing for a while around 1+ years Due to some personal problems Now I have struck up with new issue. Its ADOBE PDF forms. I am Entirely new to this topic & knows about Nothing. My requirement is to display a report in PDF

  • Problem with call transaction KKS2

    Hi all, I am using call transaction method for KKS2 for variance calculation but it is not working. Could you please let me know what can be the reason ? also do we need to use commit work after call transaction ? Regards, Anubhuti

  • Mixing Java with Oracle Forms 11g

    What's going on is I wrote a program for work that allows the user to upload a document from their computer onto the database and then download it back later. Now I have to take that and integrate it into a button in Oracle Forms because our actual p

  • How to have iPad (iOS 5) import only the JPEG from a RAW JPEG pair?

    I have an iPad 2 16 GB, running iOS 5. I also have a Canon EOS 7D. I purchased a CF Card Reader for the iPad (see http://store.micgadget.com/card-readers/280-ipad-2-cf-card-camera-connection-kit .html) so that I can view and edit photos quickly in th

  • I can't get photos on my Nano....

    I select the folders and everything, it even says "Optimizing for Ipod", but it always says that there isn't enough room for the photos. I have 10MBs of photos, and cleared 30MBs of space for them, and it still says there isn't enough room for them.