Reset a Sequence at Midnight on New Years Eve

Hi,
How can I reset a sequence generator at midnight on New Year’s Eve?
Using SQL script and SQL-Plus, I know how to set the sequence increment to a negative number large enough to return the “Next Val” to 1 (then re-set increment to 1).
But, ‘need help to understand how to cause this action to happen automatically. I’m thinking along the lines of a trigger or stored procedure.
Thank you

I have some thing to add to John's idea.
You could use a negative INCREMENT BY. Typically most sequences are created without reference to minvalue. Oracle sets a value for the minvalue. If the original sequence was not created with 'nominvalue' then, the error like the following will show up.
ORA-08004: sequence sequencename.NEXTVAL goes below MINVALUE and cannot be instantiated
Hence you are better off doing the following in order.
1. Alter the sequence and set the appropriate negative INCREMENT BY and also specify 'nominvalue'.
2. Use a select statement to get the next value.
3. Alter the sequence a second time to set INCREMENT BY to the original value.
Some one could put this in a script and run it only once.

Similar Messages

  • IPhone 5 Apps won't open after New Years Eve

    I got a new iPhone 5 for Christmas.  Everything was working fine up until New Year's Eve.  On January 1st non of my Apps will open.  I've deleted them manually from the phone and reinstalled them from the App Store, powered phone off, put phone in airplane mode and non of my purchased Apps will open.  Only Apps that work are those that came pre-installed.  I'm thinking I might just go back to using my 3GS never had an issue.

    Panic over!!! I just hit one of the apps and it opened....not sure what is going on but all looks good now.  Phew what a relief.

  • Verizon New Years Eve Shambles!

    Dear Verizon,
    I held a NYE party, in Columbia MD. All was good and everyone was having fun.
    As I had decided to deck the garage out, into a 'NightClub Scene' for the final hour or so in New Years, I thought it would be good to crank some music up and through. I tested this the night before, all was good.
    So, how annoyed was I when come 1030 at night, I could barely play a track from my library across the Wifi or You Tube or any other streaming service - Its not like I was hammering it with HD content was it.
    It was great if i wanted to play musical statues, but I didnt - I wanted to dance with my friends and celebrate new year and my verizon service was just dreadful - So thanks, for nothing - they day I get anywhere near what verizon offer in terms of speed I ll be amazed.
    Thanks
    Paul

    FYI, you're talking to customers here.
    If you had trouble using WiFi to access your home library on your home network, that wasn't a Verizon network problem.  You most likely were at the limits of your WiFi range or had other WiFi interferers in your area.  For example, if some of your guests had WiFi hotspots turned on, that could slow down your WiFi.
    Had you tested WiFi coverage in your garage before hand?
    If a forum member gives an answer you like, give them the Kudos they deserve. If a member gives you the answer to your question, mark the answer as Accepted Solution so others can see the solution to the problem.

  • Date & time problems after new year

    Hi,
    First of all, HAPPY NEW YEAR!
    After the new year my date and time is always changing to a date in the year 1969. I do reset it whenever I turn my pb on. But it always goes back when I turn it off. What could be the reason?

    Hi, zoha. Your internal PRAM battery is dead and needs to be replaced. It's just coincidental that it happened to die at the end of the year.

  • My iPhone won't connect to the Internet after new year. What can I do?

    WHy won't my iPhone 6 connect to the Internet after the new year? My wife has the same phone and it works. I have tried wifi or lte. I woke up this morning jan 1 2015 and it will not connect to anything.

    Settings>General>Reset
    Choose Reset Network Settings
    Your phone will restart. Test internet after that.
    ~Lyssa

  • MY IPHONE DELETED ALL MY CONTACTS - AT THE STROKE OF NEW YEAR

    2012, end of the world?
    Last night, New Year's eve, at midnight, my iPhone deleted ALL of my contacts. That was nearly 5000 contacts! I don't use MobileMe as far as I'm aware, and I don't want to sync to my computer lest it deletes all contacts from there too. How do I restore my contacts??!!

    It will COMPLETELY restore everything to how it was the instant you backed up. However, you can back up your current state on your iPhone, restore from the previous backup, get the contacts, sync with iCloud, then restore from the latest backup to have your contacts AND diary entries.
    This post shows that you are using iOS 4.3.3. To use iCloud requires that you upgrade to iOS 5.0.

  • Automatic New Year mails?

    I had a thought about sending a bunch of e-mails at exactly midnight on Friday/Saturday. I thought it might also be a good way to learn more about *nix/Arch. Thanks to the wiki entry on smtp, I managed to send mail from the command line. I was then going to use cron to send the mails at the right time. I have friends who live outside of my timezone, so I made a few textfiles with their details and a message, as described in the wiki.
    I have three questions:
    1) Does my crontab look OK?
    0 0 1 1 * alex ssmtp [email protected] < /home/alex/.bin/newyearmail.txt
    0 9 1 1 * alex ssmtp [email protected] < /home/alex/.bin/newyearmail-uk.txt
    0 14 1 1 * alex ssmtp [email protected] < /home/alex/.bin/newyearmail-us.txt
    0 8 1 1 * alex ssmtp [email protected] < /home/alex/.bin/newyearmail-nl.txt
    2) How can I make it even better/add more bells and whistles and sillyness?
    3) How would you accomplish the same using Arch? I don't use Mutt, but I understand I could send an attachment if I went that route.

    For once off tasks, atd is more suitable than cron...
    $ at 23.59 Dec 31
    mail -s "New Year Message" [email protected] < /home/alex/.bin/newyearmail.txt
    ^D
    $
    Don't forget to make sure the atd daemon is started
    Last edited by fukawi2 (2009-12-29 21:21:01)

  • Gremlins Strike After New Year

    Well, Y2K came almost a decade late but it seems that the new year has brought some new gremlins to my previously acceptable 7216 DVR as well as my non-dvr STB. The DVR no longer does basic functions like pause or rewind on "live" programs - if I can make it pause after repeated button presses, there is no saved content to rewind through (it jumps ahead to real time). There are also lip-synch issues for the first time ever. Multiple hard reboots have limited effect as the symptoms sometimes manifest, and sometimes don't. Also, I had to do a hard reboot on the non-DVR HD STB for the first time ever since the TV display said "no signal". As stated, I never had problems like this, mostly because I faithfully do a hard reboot twice a week. Now it doesn't seem to matter. I wonder if the new year (leap year?)  messed up the software? Not being an engineer, this is very frustrating and I truly believe these hardware issues (see this forum)  to be the Achilles heel for Verizon FIOS. Verizon must rectify the hardware reliability factor soon.  Thank you.

    retiredme wrote:
    Well, Y2K came almost a decade late but it seems that the new year has brought some new gremlins to my previously acceptable 7216 DVR as well as my non-dvr STB. The DVR no longer does basic functions like pause or rewind on "live" programs - if I can make it pause after repeated button presses, there is no saved content to rewind through (it jumps ahead to real time). There are also lip-synch issues for the first time ever. Multiple hard reboots have limited effect as the symptoms sometimes manifest, and sometimes don't. Also, I had to do a hard reboot on the non-DVR HD STB for the first time ever since the TV display said "no signal". As stated, I never had problems like this, mostly because I faithfully do a hard reboot twice a week. Now it doesn't seem to matter. I wonder if the new year (leap year?)  messed up the software? Not being an engineer, this is very frustrating and I truly believe these hardware issues (see this forum)  to be the Achilles heel for Verizon FIOS. Verizon must rectify the hardware reliability factor soon.  Thank you.
    Try getting Tech Support to do a reset on your equipment.  That may resolve the issues you're having.  I was experiencing some problems that a hard reboot no longer fixed (although it had on previous occasions).  After they did the reset, the problem I called about as well as several other minor issues I was having, were all fixed (for now anyway).  I also have lip-sync problems (written about in another thread.  It's a recurring problem that gets worse with time.)  A reset from Verizon always greatly improves this, although it doesn't outright fix it.  (Lots of speculation about whose fault this problem is and most fingers point back to the broadcasters.  My thought on this is if they were actually the cause, why doesn't everyone experience this problem and why does the reset improve the sync???)  So, calling in for a reset might be worth a try.  (Maybe they ran a gremlin elimination program along with the reset?!?!)

  • TS1544 I forgot my Keychain Password. As I follow the steps, after clicking ""Reset to my default Keychain""a new window showing ""UNIX[Invalid argument]"". Give me a solution to reset my Keychain Password.

    I forgot my Keychain Password. As I follow the steps, after clicking ""Reset to my default Keychain""a new window showing ""UNIX[Invalid argument]"". Give me a solution to reset my Keychain Password.

    DO A BACKUP FIRST
    Use your recovery partition so you can reset everything.(power up up holding the COMMAND R keys and restore OS X You can do a restoration and start from square one.
    Your profile does not disclose the version of OSX but from the forum you posted in I assume your are running 10.7 Lion, which is wnat a Mac uses.You have listed in your profile iOS and a iPhone, iOS is used for iPhones, iPads, iPods...mobile devices, and is quite different from OSX which is used by Mac computers.
    As well as the year and model ID of your mac. (You can find this info by clicking on the Apple logo in the menu bar>About this Mac>more info/system profile (depending on which OSX you are using) then posting it, so that we can eliminate the "guessing" of of how to possibly provide help/advice/suggestions to you
    Without this info it is difficult to help someone reading this post to offer advice/suggestions.

  • Multiple libraries, projects and reorganizing for the new year

    I have used Aperture since 1.0 and really like it but the growing pains are still present - over time of use, I've ended up with multiple libraries [2 main ones and 2-3 little ones that probably can be safely archived]. I want to start fresh in the new year and have a new Library that is my main one, my only one in fact == is it possible/feasible/desireable to export projects from Library A and B and then import the ones i want into my 2007 Library the way my new organizing system will be? I mainly have images according to geography and people [e.g. people in locations versus family and friends]. Can I consolidate all my Libraries into one new one for use in the future ?? Will exporting each project and then importing into my new master Library work??

    I've been thinking just a little about what features I would like the next rev of aperture to have. Though I haven't thought through the specifics, easier and more efficient use and management of multiple libraries, projects etc would be nice. Whole aperture projects referenced from multiple libraries or some such? (I said I hadn't thought it through!)
    It's over a year since aperture came out, macworld is coming up, and I suspect that 2.0 will be released eventually some time in the future, perhaps with changes (maybe even improvements!) in library and project workflow.
    So while I too am considering how to organize my own aperture materials I am currently holding off for bit just in case there might maybe possibly be (Conjecture Warning!!!) something new announced soon....
    MBP17 2.16 ghz 2gb 120gb   Mac OS X (10.4.8)  
    MBP17 2.16 ghz 2gb 120gb   Mac OS X (10.4.8)  

  • How do I move an account to the top of the column of accounts? I have version 31.3. Thanks for any help you can offer and Happy New Year!

    I see that my Thunderbird account listings (in the leftmost column) are alphabetical. I want to move the bottom listing to the top. Is this possible? I'm using Windows 7. Oh, and did I mention Happy New Year?

    Try this add-on:
    https://addons.mozilla.org/en-US/thunderbird/addon/manually-sort-folders/
    http://www.ramsden.org.uk/3_How_to_install_Add-ons_in_Thunderbird.html

  • How to change the year in a range of column dates to the new year?

    How to change the year in a range of column dates to the new year?

    Depends on the pattern of the dates. The last procedure will work for any pattern, or no pattern at all.
    For examples.the dates are assumed to be in column A, starting at A2
    Sequential dates?
    Enter first updated date in the first cell.
    Enter =A2+1 in cell A3. Copy the cell.
    Select A3 to the end of the list. Paste.
    With the cells still selected, Copy, then go Edit > Paste Values.
    Evenly spaced dates?
    Same procedure as above, but replace +1 in the formula with + and the number of days between dates in the list.
    Randomly spaced dates?
    Select cell B2. Press option-left arrow to insert a (temporary) column to the left of column B.
    Click on the empty cell B2 in the new column. Enter the formula below:
    =DATE(YEAR(A)+1,MONTH(A),DAY(A))
    Copy the cell, then select B2 - Bn where n is the last ow containing a date to be converted. Paste,
    With the cells still selected, Copy.
    Click on A2, then go Edit > Paste values.
    Click on the column B reference tab to select all of column B.
    Hover the mouse over the right end of the reference tab, and click the black triangle when it appears.
    Choose Delete Column from the menu that appears.
    Regards,
    Barry

  • My original Apple ID is associated with an email address that I no longer have access to. How do I reset the system to recognize my new email address as my primary point of contact and erase the other one?

    My original Apple ID is associated with an email address that I no longer have access to. How do I reset the system to recognize my new email address as my primary point of contact and erase the other one?

    If when you go to icloud.com and sign in with your current iCloud ID you see all your iCloud data there, you can safely sign out of the iCloud account on your Mac and choose Delete at all the prompts, then sign back in with the current ID.  This only deletes the data from your Mac, not from iCloud.  Your iCloud data will reappear on your Mac when you sign back in after a brief delay as it redownloads.  If you have automatically imported your photo stream photos to your iPhoto library you won't lose them either (if you haven't, save them to your library first).
    Again, only do this if when you go to icloud.com with your current ID you see your iCloud data there.

  • HT2523 How do I add shadow to the title of a document while in Pages? For instance: NEW YEAR'S NEEDS. I'm also at a loss to know how to create a folder for certain types of documents such as "Sermons" or "Lessons."

    How do I add shadow to a title, such as, NEW YEAR'S NEEDS, while in Pages? I also don't know how to set a new folder for documents of the same type such as, "Sermons," or "Lessons." Any help will be greatly appreciated.
    Donnie

    Yes, I very well may be over thinking this, but I tried duplicating and moving it, but the text distorts slightly, which can be mostly remedied by rotating it on the x-axis, although the light is still off. And the shadows and reflections are not visible - this is pic1... In pic2, I used "rotate 3d object" with the green and red arrows,  instead of just sliding it up the y-axis using the coordinates in the scene tab. Using the green and red arrows to move the text preserved the reflections but the shadows now aren't visible. It was also hard to align the text perfectly in scenario 2. Thanks for the help

  • A New Year, a New Challenge! Become the FIRST WPF Guru of 2015!

    Happy New Year!
    "Guru 2014" is so 'last year'!
    The real glory is to be the first Guru of 2015! :D
    The birth of a new year, and a new hero?
    Or the stamp of authority from long established Guru leaders?
    The challenge is on, all eyes are watching, anyone could win this month.
    The prize? Glory! Honor! Virtual medals! Unashamed love and worship from those within the community and those bloging about it (article spotlights,
    weekly awards).
    Published interviews and the chance to climb the TechNet social ladder. Become a true TNWiki Ninja and
    advance through to black belt... and beyond!
    All you have to do is add an article to TechNet Wiki from your own specialist field. Something that fits into one of the categories listed on the submissions page. Copy in your own blog posts, a forum solution, a white paper, or just something
    you had to solve for your own day's work today.
    Drop us some nifty knowledge, or superb snippets, and become MICROSOFT TECHNOLOGY GURU OF THE MONTH!
    This is an official Microsoft TechNet recognition, where people such as yourselves can truly get noticed!
    HOW TO WIN
    1) Please copy over your Microsoft technical solutions and revelations to
    TechNet Wiki.
    2) Add a link to it on
    THIS WIKI COMPETITION PAGE (so we know you've contributed)
    3) Every month, we will highlight your contributions, and select a "Guru of the Month" in each technology.
    If you win, we will sing your praises in blogs and forums, similar to the
    weekly contributor awards. Once "on our radar" and making your mark, you will probably be
    interviewed for your greatness, and maybe eventually even invited into other inner TechNet/MSDN circles!
    Winning this award in your favoured technology will help us learn the active members in each community.
    Feel free to ask any questions below.
    More about TechNet Guru Awards
    Thanks in advance!
    Pete Laker
    #PEJL
    Got any nice code? If you invest time in coding an elegant, novel or impressive answer on MSDN forums, why not copy it over to
    TechNet Wiki, for future generations to benefit from! You'll never get archived again, and
    you could win weekly awards!
    Have you got what it takes o become this month's
    TechNet Technical Guru? Join a long list of well known community big hitters, show your knowledge and prowess in your favoured technologies!

    Happy New Year;)
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for