Trouble with SEQUENCE, loosing numbers

Hi all, I use a sequence to generate the number of an invoice like this:
Insert into table
values(owner.sequence_name.nextval);
But, if an error occurs this number get lost because of the way the sequence works, how can I avoid this??, there is another way to do it??? It doesnt matter if that solution doesn't use the sequence, but my design cannot accept numbers like 1,3,4,5,7, it has to be 1,2,3,4,5,6,7....
Leo
null

Unfortunately, this is another one of those concepts that sounds simple but isn't.
Yours is not an Oracle (or any other DB) problem; it is a design problem.
The reason that none of the suggested alternatives solve your problem is that there are undefined elements in your requirements.
There are actually two aspects to your of problem: 1) generating unique sequential numbers and 2) using those numbers.
I would suggest starting over and try to clearly define the problem and the requirements.
For example your stated requirements appear to be something like:
1. Invoice numbers must to be unique
2. Invoice numbers must be numeric
3. The first invoice number must be 27 (modify per your requirements)
4. Each new invoice must be numbered one higher than the previous invoice.
5. Invoice numbers must be sequential with no missing numbers.
While the above list seems to be complete there are some very important questions that are not yet answered.
1. When does an invoice become an invoice? That is, when is the invoice number assigned? Is the number assigned before or after the invoice record is committed to the database? If the number is assigned before committing (e.g. when the user begins processing an invoice) but the invoice is then abandoned and never committed there will be a gap in invoice numbers.
2. Can invoice records ever be deleted? If a committed record is deleted there will be a gap in the numbers. Some systems handle deletions by either flagging the records as deleted without actually deleting them or moving the records to a deleted table so that all invoice numbers are always accounted for.
Check printing applications used to print on pre-numbered check forms. The line printers that were used had sprockets to feed the checks and the first check could not be printed on since the sprockets were above the print head. The operator would enter the first check number into the system and the application created a check record marked VOID for that check number. This ensured that all pre-printed checks were accounted for and had not been misplaced or stolen.
Oracle's sequence generator can generate sequence numbers in sequential order and ensure that there are no gaps in the generation process.
Oracle cannot ensure that your application uses those numbers in a way that avoids gaps.
Even a normal INSERT trigger that might be used to get the next sequence value cannot be certain that the record it is inserting will actually be committed unless the COMMIT operation is performed within the trigger.
Sorry to 'rain on your parade' but withouth a better problem definition we can't give you a better solution.

Similar Messages

  • Troubles with Sequences

    I have tried unsuccessfully to use different methods in gumbo to replace tweenmax and had very little success the closest I have come is with parallel sequences but still not really achieving what I was hoping to do , targeting objects is the first issue(even with sequencing) as the only way I have suceeded so far is to target an object before playing a sequence as below, but I want to include multiple targets within a series of effects and declaring the target within a sequence just fails.
    PageL.rotationY=180;
    flipper.target=paperMod;
    flipper.play();
    TweenMax.to(PageL,2,{rotationY:1, delay:0.100});   <------ I really don't want this here
    this is the sequence
    <mx:Sequence id="flipper">
    <mx:Parallel duration="500">
    <mx:AnimateProperty property="force" fromValue="0" toValue="1.8"/>
    <mx:AnimateProperty property="angle" fromValue="-1.00" toValue="-0.25"/>
    <mx:AnimateProperty property="offset" fromValue="1" toValue="0.3"/>
    </mx:Parallel>
    <mx:Parallel duration="750">
    <mx:AnimateProperty property="force" toValue="0" fromValue="1.8"/>
    <mx:AnimateProperty property="angle" toValue="-1.00" fromValue="-0.25"/>
    <mx:AnimateProperty property="offset" toValue="1" fromValue="0.3"/>
    </mx:Parallel>
    </mx:Sequence>
    this is the tweening I want to replace
    protected function button2_clickHandler(event:MouseEvent):void
    PageL.rotationY=180;
    paperMod.force = 0;
    paperMod.offset = 0.95;
    paperMod.angle =  0;
    rev=true;
    myTween = new TweenMax(paperMod, 0.75, {force:1.7, offset:0.22, angle:-0.35, bezier:[{offset:1.2, angle:-0.7, force:1}],
    onComplete:reverseMe});
    TweenMax.to(PageL,2,{rotationY:1, delay:0.100});
    private function reverseMe():void
    if (rev==true)
    rev=false;
    myTween.reverse(false,true);
    http://gumbo.flashhub.net/flip/  - my test bed app
    So am I totally off-track or is there a way I can replace the tweening cleanly, I've tried motionpaths, animation etc... but nothing seems to work, and the big one is can I have multiple targets in a set of sequences/animations that could rival tweening.
    David

    Hi David,
    You should definitely be able to do this. The effects version is actually simpler than what you have below in Flex 4 beta (because of the new RepeatBehavior functionality and the ability for Animate to target multiple properties) (are you on Flex 4? Or using Flex 3?), but the key thing is that you have to specify the target (or multiple targets) either in the effect declaration or in the play() method when you launch it. Assuming you're okay with declaring the targets in the effects, here's how I'd rewrite your code using Flex4 effects:
    <s:Animate targets="{[paperMod, bezier]}" repeatCount="2" repeatBehavior="reverse"/>
        <s:SimpleMotionPath property="force" valueFrom="0" valueTo="1.8"/>
        <s:SimpleMotionPath property="angle" valueFrom="-1" valueTo="-.25"/>
        <s:SimpleMotionPath property="force" valueFrom="0" valueTo=".3"/>
    </s:Animate>
    If this is a question about Flex 3 effects, then I think the only thing you're missing is the targets. Add 'targets="{[paperMod, bezier]}"' to your Sequence declaration (the targets of composite effects propagate to the children unless the children override the targets).
    Does this help?
    Chet.
    ps: I have various tutorial videos on effects (Flex3 and Flex 4) on my blog at http://graphics-geek.blogspot.com - check it out if you want to get the bigger picture on how this stuff works.
    <mx:Sequence id="flipper">
    <mx:Parallel duration="500">
    <mx:AnimateProperty property="force" fromValue="0" toValue="1.8"/>
    <mx:AnimateProperty property="angle" fromValue="-1.00" toValue="-
    0.25"/>
    <mx:AnimateProperty property="offset" fromValue="1" toValue="0.3"/>
    </mx:Parallel>
    <mx:Parallel duration="750">
    <mx:AnimateProperty property="force" toValue="0" fromValue="1.8"/>
    <mx:AnimateProperty property="angle" toValue="-1.00" fromValue="-
    0.25"/>
    <mx:AnimateProperty property="offset" toValue="1" fromValue="0.3"/>
    </mx:Parallel>
    </mx:Sequence>
    >

  • Trouble with Sequence of Product Allocation Procedures in GATP

    Hi,
    I have created two allocation procedures. ZATP1,  ZATP2.  The expected result is the total quantity confirmed by ZATP1 + ZATP2.  In the ATP simulation, I am getting only the output  confirmed by procedure ZATP1.  The following are my settings.
           1. Created a procedure ZATP1 : I checked this individually in simulation and it is working
           2.  Created another procedure ZATP2 : I checked this individually in simulation and it is working
           3.  Created a "Sequence of Product Allocation Procedure ZSEQ" containing allocation procedure ZATP2.
           4. In the product master "ATP" tab I have updated , "Allocation Procedure" =ZATP1  and  Procedure Seq = ZSEQ. 
    Can any one you tell me what I am missing to achieve this business requirement?  Any one faced a similar problem ?   We are in SCM 5.0
    /Shibu

    Thanks for the reply. I maintained only location <b>independant</b> product allocation with allocation sequence.
    To replicate the scenario :
         We have two organizations who can make the allocation. Both are independent and shouldn't distrub each other. (Only production allocation check is configured in the check instructions).
    The planning area I maintained are
        <b>ZDP01 :</b>  CVC : Allocation object :ZATP1 , Commerical model : A100 , Customer : 1000
    For Oct : total allocation : 2000   Consumed :800
    For Nov : total allocation : 1000  
    <b>ZDP02 :</b>  CVC :      Allocation object :ZATP2, Commerical model : A100 , Customer : 1000
    For Oct : total allocation : 500   Consumed :300
    For Nov : total allocation : 500  
    THe customer "1000" is now placing an order of  1250:  He should get confirmation in oct because 1200 can be given up by ZATP1 and 50 can be given by ZATP2.
    The result I am getting via ATP simulation is 1200: Oct  and 50 Nov. (Both consumed against ZATP1):
    Thanks again for sparing time on this issue.
    /Shibu

  • Trouble with Excel serial numbers to Dates

    Hi,
    I am new to Numbers V3 (latest) but know Excel and Open Office
    I have converted an Open Office worksheet to an Excel .xls which was then opened in Numbers.
    The dates entered on the OO and Excel sheets appear in date format correctly and I then calculate the length (of rental) from 2 dates.
    In Numbers the cells now contain the date serial numbers but I cannot get a date to appear. Frustrating!
    I have opened format and tried to change the format of one cell to "date". Nothing happens.
    My first thought is that I am not doing the formatting correctly. I click on the brush, open the window, change Data Format to Date and Time.... Then how do I accept this? I see no "Done" button so I just close the window by clicking the brush again and nothing changes. When I reopen the format window it still shows my data as a number. However if I change say the "Fill colour" section underneath, when I close format it changes the cell colour.
    This happens in the cell I imported AND in a new cell in a new column.
    I notice that if in the same cell I enter 20/11/2013 the Format box shows "Date and Time". If I then enter a number the Format box changes to "Number" so it is perhaps not here that I change the format.
    What am I missing?
    Henry

    Henry,
    Simply stated, Numbers doesn't recognize date serial numbers. Your input will have to be in a form that looks like a date to a human.
    If an input looks like a number, that's how Numbers will treat it.
    Jerry

  • Issues with Sequence Generator

    I'm having trouble with Sequence generator not generating continuous numbers starting from 1, each time I run the mapping.
    I want the Sequence to start from 1, each time the mapping is run. For this to happen, I'm using a pre-mapping operator which uses an oracle procedure to reset the sequence.
    But, the sequence generates the numbers from some weird number, say 3508 and then jumps to 5006 and so on. I'm not able to track what's wrong with the sequence. I have stopped the caching in Sequence but still it hasn't helped. I'm sure and have verified that the procedure being used to reset the sequence is running fine.
    Please suggest some additional parameters/properties at OWB level to be checked for the sequence, if any OR any thoughts on why the sequence is not starting from 1. Thanks in advance.
    Thanks,
    Sachin
    Edited by: 850549 on Apr 23, 2011 11:43 AM
    Edited by: 850549 on Apr 23, 2011 11:44 AM

    Could you check whether the sequence you use has a cache value greater than 1 defined in the database. This way if your database regularly should be stoped, e.g for offline backup, you'll loose the sequence values that were unused in memory at that time. That way the gaps in your surrogate ids would be explainable.

  • TS5376 I  am having trouble with an update.  Now my Itunes won't open.  i see the instructions to uninstall Itunes.  My concern is will I loose all my music by doing so?

    I am havign trouble with an update.  Now my Itunes will not open.  I see the instructions on how to uninstall and reinstall Itunes.  will I loose my music as a result fo uninstalling Itunes?

    You music is safe. You should backup the library anyway.
    See Troubleshooting issues with iTunes for Windows updates.
    tt2

  • WRT300N vers. 2 europe. firmware 2.00.20 trouble with loosing intenet after abourt 2 minutes

    after upgrading from firmware 2.0017 to 2.0020  i have trouble with the wireless connection to internet.
    After i have been logged on in about 2 minutes i loose connection to the internet.
    there is still wireless connection to the router.
    This has happended just after i upgraded, i had no problems before.
    Can anyone help?
    Regards

    I talked with Linksys support today about my problem and they will replace my router to a new. They have not that problem with that firmware version.

  • I am having trouble with the "numbers" app on my MacBook Air. I go to print my document and that works just fine. I cannot however return to the document after printing. What do I have to do?

    I am having trouble with the "numbers" app on my MacBook Air. I go to print my document and that works just fine. I cannot however return to the document after printing. What do I have to do?

    RR,
    Not to worry, you're not the first to expect Print to finish by returning you to the edit mode. The thing is that Printing is so hit and miss with this version of the app, you will probably want to stay in the Print window for more than one attempt.
    Jerry

  • Can i safely trash Iwork '08 since i have already Installed Iwork '11 or will i loose my documents made with pages and numbers '08???

    can i safely trash Iwork '08 since i have already Installed Iwork '11 or will i loose my documents made with pages and numbers '08???

    You can have multiple versions installed simultaneously.  It won't hurt to delete the '08 apps, because the '09 apps will convert '08 to '09, but there is no reason to do the deletion.
    You say that you have iWork '11.  If that's true, it's really big news.  More likely, you have iWork '09.
    Jerry

  • (Trouble printing) Trouble with connection between Macbook Pro and Hp Deskjet 1510.

    Trouble with connection between Macbook Pro and Hp Deskjet 1510. (Nothing Prints).
    I have a Macbook Pro and am having difficulty printing documents from ‘Pages' from my Hp Deskjet 1510. I have installed the necessary software for the printer and it is connected via USB. Every time I try to print the printer icon comes up as it should, 'printing' and then 'job completed' and then the icon disappears. (Nothing is printed.) I thought it might be something to do with Pages compatibility with the printer but exporting the document to Word or making it a PDF doesn’t change anything. I don’t have Microsoft Word on my computer. The scanner does work and when I printed a ‘Test Page’ that worked too.
    Let me know if you know why this is happening.

    With these settings the network now works flawlessly, however, when i have my ethernet cable plugged in, my internet access via my airport card(on the macbook pro) is no longer available. Hoping you can tell me why this would be with this info i've provided.
    Educated guess. The networking devices have priorities as to which are used. The standard order is that Ethernet has a higher priority than Airport.
    While your Ethernet is unplugged it is inactive and the Mac ignores it. Once you plug it in, the Mac sees that it is active and switches traffic to that interface.
    I actually take advantage of this feature at home, but configuring my Airport and Ethernet with identical fixed IP addresses. Normally I'll use Airport, but if I'm copying a huge file and I want faster performance, I'll just walk my MacBook (previously iBook, previously Powerbook) over to my Ethernet switch and plug in my MacBook. Magically, the Mac detects that the Ethernet is active and continues the file transfer uninterrupted over the faster 100baseT Ethernet connection. When the transfer is finished, or if I really need to move back to the Comfy Chair, I unplug the Ethernet cable, and all activity reverts back to the Airport, all without disrupting any existing networking connections.
    You on the other hand have totally different settings for your Ethernet and your Airport, so when you switch to Ethernet, you basically loose your Airport connections.
    Something you can try:
    System Preferences -> Network
    Gear icon on the bottom left, next to the [+] [-] icons.
    Select *Set Service Order...*
    Now Drag the network interfaces into the perfer priority order you want. In this case put Airport above Ethernet.
    NOTE: You may want to create a new Network Location for this, instead of messing with your normal home Location (which is most likely the default Automatic. That way you have your original you can always fall back to.

  • IMessage trouble with two iPhones and one Apple ID

    Hi,
    I'm having trouble with iMessage after updating both of my iPhones to iOS 6 and not being able to use iMessage with one of the phones.
    Some background:
    -I have two iPhones, one on AT&T in the U.S., and one on NTT DoCoMo in Japan, both with separate phone numbers, using the same Apple ID.
    -The AT&T iPhone is a 4, the NTT is an unlocked 4S.
    On my 4 (AT&T), on iMessage, I have the option to send/receive as my U.S. phone number and my Apple ID. Works just like before updating.
    On my 4S (NTT), on iMessage, before I updated, I was able to send/receive using my Japanese number and Apple ID. After updating, I have the option to send/receive using my U.S. number and Apple ID. My Japanese number is greyed out and I cannot select it. When I turn on iMessage, it says "Waiting for activation..." and does not do anything. Turning iMessage off and on, some times I get an error message staying that activation cannot be completed.
    I have rebooted the phone multiple times, turned on/off iMessage and FaceTime, turned the Set Date & Time Automatically option on/off, and reset Network settings several times. Nothing works; iMessage will not activate on my NTT 4S. Please help!

    Finally resolved this issue after months of off and on troubleshooting.
    I have no idea exactly which steps "fixed" the issue, but here's what I did. None of the basic troubleshooting steps that are on here worked for me, and this is including restoring both phones in iTunes as a "last resort" step that two Apple technical service representatives suggested.
    I found a post on here from user "tungddao" who suggested:
    "Turn on iMessage then make a phone call to : 011+445773142076
                 With Facetime & Siri: 011+447786205094"
    I called both numbers with my NTT 4S, and both numbers hung up right away. I also texted both numbers, and the FaceTime one went through, while the iMessage number did not. I then checked my SMS blocking settings with NTT. There were no blocks, but I reset the settings to "unblock all" anyway.
    I was able to activate iMessage and FaceTime with my Apple ID and my NTT phone number. Halfway there.
    I then turned on my ATT 4, and while I could send/receive using my Apple ID and NTT phone number, the ATT number was greyed out, which was the opposite of what had happened before, when I could use the ATT number, but not the NTT one. On my NTT 4S, I could select my ATT number, but it was stuck on "verifying" for days, and I knew it wouldn't go through.
    So, I signed out of my Apple ID on iMessage and FaceTime on my ATT 4, and turned both services off. I turned on data roaming, and turned off WiFi. *This step was key to activating both services, as they would not activate over WiFi for some reason.
    I turned on iMessage and FaceTime without signing in to my Apple ID just yet. They both activated successfully, and then I signed into my Apple ID on both services, and from then on, I can use both numbers and my Apple ID on both phones! Finally!
    These are my current options:
    Phone 1 (4S on NTT): Phone 1's #, Phone 2's #, Apple ID
    Phone 2 (4 on ATT, roaming here in Japan on Softbank): Phone 2's #, Phone 1's #, Apple ID
    Hope this helps someone out there, as this issue was real frustrating for me.

  • Trouble with Time Machine/Time Capsule try Backup instead

    Trouble with Time Machine preparing to download taking hogging your system followed by errors that don't make any sense even if you look at the console logs to try to figure out. Try Backup instead.
    Find the software here:
    http://www.apple.com/downloads/macosx/apple/application_updates/backup312.html
    It allows you to configure when to do back ups and specific data you want, and includes templates for configurations to make it easy. The only catch is you loose the Time Machine benefits of restoring an individual file easily. For me it gets around the issues w/ Time Machine hogging my system resources (Finder at 98% CPU cycles both cores) while "preparing backup", followed by strange failures that can't figure out, followed by more "preparing backup".

    I was running backup instead of time machine until I saw snow leopard had time machine improvements. I'm very happy with the performance so far w/ snow leopard (OS X 10.6) time machine performance.

  • I'm having trouble with installing a 8g kit in my late 2009 mac mini. when the parts are installed all i get is a beeping sound, is there any way to get around this?

    i'm having trouble with installing a 8g kit in my late 2009 mac mini. when the parts are installed all i get is a beeping sound, is there any way to get around this?

    What is the source & link to this 8 GB kit please?
    Can you count the beeps or flashes?
    1 beep = no RAM installed
    2 beeps = incompatible RAM types
    3 beeps = no good banks
    4 beeps = no good boot images in the boot ROM (and/or bad sys config block)
    5 beeps = processor is not usable
    In addition to the beeps, on some computers the power LED will flash a corresponding number of times plus one. The LED will repeat the sequence after approximately a 5-second pause. The tones are only played once.
    Note: In this case, a flash is considered to be 1/4 second or 250 ms or greater in length.
    http://support.apple.com/kb/HT1547

  • How can I figure out what my password is and keep it unlocked?  Every time I do a system update, it requires the password and sends me into cyber trouble with the remember my keychain access, requiring it every time I log in.  A real hassle to be avoided

    How can I find out what my password on the computer is?  I had to change it due to my teenagers helping themselves, and now every time there is a system update, I have to have the password, which I cannot remember or find.  It then wants it every time I log in and pops up Key Chain Access as well.  Very annoying.  I do not have the disc to reload it and fear I would loose everything on my computer as there is also trouble with the back up system.  Too many issues and not enough solutions.  Many thanks in advance!

    I do not have the disc to reload
    Why not?  You need your system dvds to troubleshoot & to reset/change passwords in view of your current OS listed in your  profile. 
    You can get replacement System Install & Restore CD/DVDs from Apple's Customer Support - in the US, (800) 767-2775 - for a nominal S&H fee. You'll need to have the model and/or serial number of your Mac available.
    If you're not in the US, you may need to go through the regional Apple Store that serves your location to find the contact number. Here's a list of links to all of those - http://store.apple.com/Catalog/US/Images/intlstoreroutingpage.html Another resource:  International Support Phone #s.
    ===============
    I have to have the password, which I cannot remember or find.
    When selecting passwords, make sure it's one that you will NEVER forget AND no one else can figure out. 
    Old school--- > Print it out & keep in a safe place.  A place that ONLY you know about AND never forget.
    New school---> Get a password manager utility.  Highly recommend 1Password which is shareware.  Do a Google search for free password managers.

  • Trouble with sorting albums

    I have two troubles with itunes:
    occasionally my albums have their "out of" track numbers removed. so in the track # column it does not display "(track number) of (total tracks on CD)" but instead only displays "(track number)"
    And
    occasionally the LAST song of an album will above the FIRST song of the album instead of the staying as the last song. I have tried everything and cannot fix this without re burning the CD. I don't want to have to do that as I do not have my CD collection with me.
    How should I go about fixing these and making sure they dont continue to happen?

    Generally setting a common Album Artist will fix things.
    For deeper problems see Grouping tracks into albums.
    If iTunes won't accept changes to the tags see Repair security permissions for iTunes for Windows.
    If iTunes appears to accept your changes but the original values reappear later then the files are likely to be mp3s with multiple tags. In such cases iTunes only updates one of them and may later read back the unchanged data from the other. To fix this select the tracks in question in iTunes, right-click and use Convert > ID3 Tags > None, several times, then use Convert > ID3 Tags > ID3v2.3. You will need to reinsert any embedded artwork.
    tt2

Maybe you are looking for

  • The WORST of Verizon Wireless

    The "customer service" I have experienced through interactions with Verizon employees over the past week has been nothing short of terrible. Here are a few of the best examples: 1. Went to Verizon Store in person to upgrade my broken iPhone (2 months

  • Where did my cloud go

    I replaced my macbook pro with a new hd because original crashed. I was able to restore some of my music from icloud. Now the cloud is gone from my itunes, why? Where did it go?

  • How do I get an iPod to play indefinitely?

    How do I get music to play indefinitely in my iPod? I shuffle a playlist and it plays until every song has played once, then it stops. I need it to shuffle indefinitely until I choose to stop it, is there any way to do that with a playlist? Or a comp

  • More email problems - same as other users

    Same as other users, suddenly my BT email account refuses to let me receive or send messages, whether using Outlook on a PC or the Apple client on an iPad or iPhone.  All worked yesterday! Interestingly, I am also unable to login to btyahoo, it says

  • Sap BO Disclosure Management "Could not get Chapter:Connection" Error

    Dear Gurus, When i try to View/Edit and download from netweaver to client, i am taking error like this ; 2/27/2014 3:17:44 PM Start 2/27/2014 3:17:44 PM frec:http://bw01.vektora.com:90/WebServices/WDocumentService.asmx|0|7|wt1nko55j2ylzw45xjfjia45 2/