Increment value in a field but keeping it constant throughout the day

In a PRE-INSERT trigger on an application I have a problem
keeping the value in a field constant for the rest of the day
until the next day. The automatically generated number should
change only if the system date changes. How can i do this?.
The code is as below:
begin
                    update sequence_number
               set maxseqno = maxseqno + 1
                    where table_name
= 'ECONET';
begin
select maxseqno into :two.seqno from sequence_number
where table_name = 'ECONET';
end;
begin
select ltrim(to_char(:two.seqno,'00000000000000000009'))
into :two.line_number from sequence_number
where table_name = 'ECONET';
end;
begin
select ltrim(to_char(:two.seqno,'00000000000000000009'))
into :two.unique_transfer_batch from sequence_number
where table_name = 'ECONET';
end;
end;

The easist way is probably to store the date the sequence number
was last set, and then only increment the number if the date is
different.
If you just want a sequence number that changes once each a day,
an alternative might be to just calculate the number of days
since a particular date.
In oracle this would be something along the lines of
trunc(sysdate) - to_date('01-OCT-2001','DD-MON-YYYY') to give
the number of days since October 1st.

Similar Messages

  • Firefox keeps crashing constantly throughout the day

    Ever since my PC was reformatted and Firefox was installed, crashes have occurred throughout the day. First, Firefox goes into the "Not Responding" mode and then it will just crash! This happens constantly and it has become annoying and inconvenient. Here's the list of my last five crash reports:
    bp-25891ba2-5077-49a4-8413-d30822141104 11/4/2014 11:11 AM
    bp-7ae0b013-820b-4caf-8ebb-b962a2141104 11/4/2014 9:56 AM
    bp-aac75e95-810c-4315-a311-4093b2141103 11/3/2014 5:33 PM
    f4304127-7119-43d9-81de-e9eba4a75f58 11/3/2014 4:08 PM
    bp-b6dfa154-23d8-49ec-8c0c-5bfba2141103 11/3/2014 3:06 PM
    I hope someone can help me resolve this issue soon!
    Thanks.

    Hello,
    '''Try Firefox Safe Mode''' to see if the problem goes away. [[Troubleshoot Firefox issues using Safe Mode|Firefox Safe Mode]] is a troubleshooting mode that turns off some settings, disables most add-ons (extensions and themes).
    If Firefox is open, you can restart in Firefox Safe Mode from the Help menu:
    *In Firefox 29.0 and above, click the menu button [[Image:New Fx Menu]], click Help [[Image:Help-29]] and select ''Restart with Add-ons Disabled''.
    *In previous Firefox versions, click on the Firefox button at the top left of the Firefox window and click on ''Help'' (or click on ''Help'' in the Menu bar, if you don't have a Firefox button) then click on ''Restart with Add-ons Disabled''.
    If Firefox is not running, you can start Firefox in Safe Mode as follows:
    * On Windows: Hold the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * On Mac: Hold the '''option''' key while starting Firefox.
    * On Linux: Quit Firefox, go to your Terminal and run ''firefox -safe-mode'' <br>(you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    When the Firefox Safe Mode window appears, select "Start in Safe Mode".<br>
    [[Image:Safe Mode Fx 15 - Win]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]] article to find the cause.
    ''To exit Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    When you figure out what's causing your issues, please let us know. It might help others with the same problem.

  • Value '61218XZEF ' from field ANZVERTR is not convertible into the DDIC

    Hi All,
    I struggling with this error can anybody pls help me.
    <b>Value '61218XZEF ' from field ANZVERTR is not convertible into the DDIC
    data type DEC in data record 1 . The field content could not be  transferred into the typed transfer structure.</b>
    This is occuring only in Prod, i have tested the same in Dev & QA but i didn't get this error.
    here the R/3 field ANZVERTR of type DEC length 6 is assigned to infoobject 0UCCNTRCNT of type DEC length 17 ( data element /BI0/OIUCCNTRCNT).
    i dont think its a problem right coz the infoobject has same type and larger size.
    i have another 3 fileds with the same problem.
    Is it a problem in BW or probelm in data being uploaded from R/3 side. coz the hasn't received in BW yet. the error says " The field content could not be  transferred into the typed transfer structure"
    Even i have PSA in parallel but data hasnt even came to PSA.
    when i check job overview in R/3 i saw a msg " Function module /BI0/QI0UC_SALES_STATS_020001 does not exist"
    when i checked this FM with other guy( coz i dont have access) it is there and is active.
    Pls anybody help me.
    Regards
    Robyn.

    Hi Arvind,
    That filed is a keyfigure coming from standard datasource 0uc_sales_stats_02 it  uses various different tables, iam not able to figure out where is it comin from.
    Is it sure that the problem is in R/3 side???
    if it is a problem in BW at least that data should have come through to PSA right??
    keyfigures coming from std. datasources goes through various extraction programs, its not field to field mapping from R/3 to BW in case of key figures i guess. correct me if im wrong.
    Regards
    Robyn.

  • I'm having trouble with my Ipod- I tried to restore it but keep getting a message - the ipod could not be restored. an unknown error occurred(1413)

    I'm having trouble with my Ipod- I tried to restore it but keep getting a message - the ipod could not be restored. an unknown error occurred(1413)
    Mt computer has been freezing up on me lately and I think it messed up my Ipod when it quit right in the middle of downloading and got shut off.

    That's because you jailbroke your phone. You can't get help here.

  • HT1766 After restoring my iphone 4 to factory settings, then restoring from a recent backup, my phone will reboot but keeps coming back to the "new setup or restore from backup screen". How can I by-pass this screen to go directly to the sync apps/music s

    After restoring my iphone 4 to factory settings, then restoring from a recent backup, my phone will reboot but keeps coming back to the "new setup or restore from backup screen". How can I by-pass this screen to go directly to the sync apps/music screen?

    Well, it's certainly behaving as though the phone that was backed up was synced to a different iTunes library.
    I'm going to throw one more thing out there... Yes, you backed it up to this computer... Was the phone previously set up to sync with this computer? Or was it syncing with a different computer and you just backed it up to this one?
    You may have to end up setting it up as a new device and rebuilding the phone by manually re-syncing your data, apps, music, etc. to the phone.
    Trying to keep your library on a different drive can be tricky. If iTunes starts up and the library isn't available, it may end up generating a new library ID, meaning that you could easily find yourself in exactly the position you're in now...
    I'm curious why there was a need to restore your phone to begin with... It may not have any bearing on this at all, but it could.

  • Trying to burn CD but keep getting error message "The attempt to burn a disc failed. The burn failed because of a medium write error. Tried different speeds with no luck

    trying to burn CD but keep getting error message "The attempt to burn a disc failed. The burn failed because of a medium write error. Tried different speeds with no luck

    The burn failed because of a medium write error. Tried different speeds with no luck
    Then try to use a different brand of DVD or at least a different batch of DVD. The disk may be defective.

  • HT4993 I changed my "invert colors" to negative and i love the way the apps look. Is there anyway that i can keep the apps looking like that but keep all my pictures the normal colors??

    I changed my "invert colors" to negative and i love the way the apps look. But is the anyway i can keep all the apps looking like that but keep all my pictures the normal colors?

    no

  • TS2784 I have set my iphone5 time settings to automatic New York time. Throughout the day the clock keeps changing times on its own by hours. Sometimes in is correct. Sometimes it is wrong.

    I have set my iphone5 time settings to automatic at New York time. Throughout the day the date and time on the phone keeps changing on its own and often by a few hours. Sometimes it goes to the correct time. Sometimes it is way out. Is there something wrong with my settings?

    This is a known issue with the iPhone 5. Turn off the automatic time setting for the time being. It will most likely be corrected in an upcoming update to iOS if the tech press is to be believed.

  • My calendar appointments show for future events, but disappear once I reach the day of the event.  So I can see tomorrow's appointments now, but they will be gone tomorrow.  Why is this happening?  It's on my iPhone and iPad.

    My calendar appointments show for future events, but disappear once I reach the day of the event.  So I can see tomorrow's appointments now, but they will be gone tomorrow.  Why is this happening?  It's on my iPhone and iPad.

    For what it's worth, you posted this in 2011, and here in 2014 I am still having this same issue. Over the last two days, I have had to unlock my apple account 8 times. I didn't get any new devices. I haven't initiated a password reset. I didn't forget my password. I set up two factor authentication and have been able to do the unlocking with the key and using a code sent to one of my devices. 
    That all works.
    It's this having to unlock my account every time I go to use any of my devices. And I have many: iMac, iPad, iPad2, iPad mini, iPhone 5s, iPod touch (daughter), and my old iPhone 4 being used as an ipod touch now.  They are all synced, and all was working just fine.
    I have initiated an incident with Apple (again) but I know they are just going to suggest I change my Apple ID. It's a simple one, and one that I am sure others think is theirs. I don't want to change it. I shouldn't have to. Apple should be able to tell me who is trying to use it, or at least from where.
    Thanks for listening,
    Melissa

  • Motorola Krave ZN4 keeps saying Verizon Wireless randomly throughout the day

    I have a Motorla Krave ZN4 that keep saying Verizon Wireless randomly throughout the day since my daughter played with my phone. I can't figure out what she hit to cause this so I can make it stop.

    nice one,, here I was looking at maybe the wall paper / background on display was removed  and the standard Verizon Logo came back up as the default.. ... thank you . Snn5 will step back and let  you handle.

  • Add an auto incremental value to TITLE field.

    Hi, i am currently working on a custom list in SharePoint 2010 and there is a title field. I would like to append an auto incremental variable to "Request" to make it look like:
    Request 1
    Request 2
    Request 3
    and so on...
    As you can see below, i tried to use the calculated value Request+ID, but it didn't work out. So is there anyway to solve this problem?
    <input name="ctl00$m$g_0bb0fcf5_65ea_4af9_ba76_7c0babad1a82$ctl00$ctl05$ctl00$ctl00$ctl00$ctl04$ctl00$ctl00$TextField"
    type="text" value="[Request-]&amp;[ID]"
    maxlength="50" id="ctl00_m_g_0bb0fcf5_65ea_4af9_ba76_7c0babad1a82_ctl00_ctl05_ctl00_ctl00_ctl00_ctl04_ctl00_ctl00_TextField"
    title="Title" class="ms-long ms-spellcheck-true" /><br />

    Hi andylow,
    You can also accomplish this without using a workflow but with a custom form on your list. To do this take the following steps:
    Make sure that the title field of your list is not a required value
    When you're in the list, click on the List tab in the ribbon
    There select "Customize Form"
    Your form will now open in InfoPath. In the right hand menu you will see all your data fields.
    Make the Title number field "Read Only". To do this right click the field, select properties, click on the second tab and select Read Only
    In the menu bar, click on Manage Rules
    Now click the Data tab in the menu and select Sumit Options
    In the menu that opens select the option to run rules before submit
    Now there will be a button available in the menu for Submit Options, click on that
    Now you can add rules and actions on the submit action
    Create a new Action rule and call it Initial Save
    As condition for the rule, set the condition that the Title field must be blank
    The first action of the rule will be to Submit the form. When the form is submitted it will be assigned an ID, before that will be blank
    Now add an Action to set a fields value.
    Select the Title field as the field to set
    You can set a hard coded value for the value to set but you can also click the function button, click on that
    Now another window opens where you can add fields, functions etc.
    Now first select the concat function from the function menu
    Then double click the first link in the resulting function and type Request
    Now double click the second link and select the ID field
    Now get rid of the last remaining arguments in the concat function
    Click OK until you're back in InfoPath
    Now set one more action to submit the form again
    Now ad a second rule and call that Edit
    As condition for the rule, set the condition that the Title field must be not blank
    Add the Submit Form action for this rule
    Now you can publish your form with the Quick Publish button. This is a Blue circle with a white upward arrow and a lightning bolt next to the save button in the top menu bar.
    Now when you add a new item and save it, the title will be set to Request&ID. When you edit the form no changes will be made.
    Cheers,
    Eduard Spelier

  • Adjusting numbers within a sum column, but keep sum constant

    Hi, all-- I've looked and looked and can't quite find a way to do this.
    I have a budget of, say, $70,000 for payroll to split among three people. I have to keep the total budget at $70,000 but I can adjust the three pay rates. Is there a way to set up a table allows me to adjust a pay rate, but keep the total constant (i.e., automatically adjust the other two values)?
    I can't seem to phrase this properly in the search function here, so my apologies if this is already answred.
    Thanks very much,
    Chris

    To do it the same basic way as above, you can have sliders for two of them but the third has to be determined with a formula. 
    B2 and B3 are sliders with the limits 0 to 70000
    B4 = if(70000-B2-B3<0, "Pay the other guys less!!", 70000-B2-B3)
    You can use sliders on all three if they set the relative amount of pay each person gets.
    C2 through C4 are sliders with limits of 0 to whatever
    B2 =70000*C2/SUM(C$2:C$4)
    B3 =70000*C3/SUM(C$2:C$4)
    B4 =70000*C4/SUM(C$2:C$4)

  • How do I install OSX onto a new SSD (in the place of my optical drive) without transferring all data across.  However, with the applications, system and library on the SSD to improve the speed, but keep non essential items (the home folder) on the HDD

    I have a mid 2009 13 inch unibody 2.53GHz MacBook Pro.  I'm finding that it doesn't run as quickly as it used to. 
    A genius in the Apple store suggested that I replace my optical drive with an SSD, however only use the SSD for OSX, applications, system and library.  Keep all documents, pictures, music etc on the current hard drive. 
    I would be grateful if someone could help me with:
    1) installing OSX on the SSD without copying across data from the current hard drive
    2) transferring applications, system and library folders across to the SSD so that they still function
    3) changing my settings so that OSX reads the home folder from the current hard drive, as well as all the applications' data (documents, music etc...)
    However, I would like to run iMovie, with all events etc solely from the SSD to speed up the process of editing movies.
    If anyone could help with this, it would be much appreciated.

    If you got the data transfer cable with your SSD, the procedure should be pretty simple - and there should be step-by-step instructions in the box. You're simply going to remove the bottom case of your computer (using a Phillips #00 screwdriver), take out the two screws in the bracket holding the hard drive into place (using same screwdriver), remove the drive and (use a Torx 6 screwdriver) remove the four screws that hold the hard drive in place. Then put in the SSD and reassemble the machine.
    Then you'll plug up the old hard drive by using the SATA to USB cable and use the option key to boot from the old drive. I don't know what data transfer software Crucial provides, but I would recommend formatting the SSD  using Disk Utility from your old drive ("Mac OS Extended (Journaled)" with a single GUID partition) and then use Carbon Copy Cloner to clone your old drive to your new SSD (see this user tip for cloning - https://discussions.apple.com/docs/DOC-4122). You needn't worry about getting an enclosure since you have the data transfer cable and you don't want to use your old hard drive.
    There are a number of videos on YouTube that take you step-by-step through this procedure - many specific to Crucial SSDs and their data transfer kit - do a little searching there if you're unsure of how to procede.
    Clinton

  • HT4993 I have 3 phones under the same apple ID. I  want to remove mine from the same one my kids use. How can I do this but keep their's on the current apple ID?

    I have 3 phones on one apple ID. I want to remove my phone which is the main phone on the acct to it's own apple ID. How can I do that but keep the other 2 on the current ID

    When you connect that iPad to iTUnes, go to the summary page and scroll down, there should be a box saying 'automatically update' or something to that effect. De select that.
    With automatically update on, what you buy on one goes onto the other. but with that box off you can choose.
    On the iPad itself, it's under
    Settings
    iTUnes and App Stores
    and then you can choose what you want automatically updated between the two devices.

  • HT1296 I am trying to sync my ipod to my computer thru itunes, I have already successfully synced my ipad, but keep getting stuck on the sync for the ipod it identifies, the device appears to be syncing but doesn't show up my new music or my new playlist?

    I am trying to sync my i-pod to my computer thru itunes.  I successfully synced my Ipad thru the computer, but am trying to do the same with the Ipod.  The device shows up on my computer and appears to be syncing, but nothing changes.  I have tried dragging the new music to the device, but a symbol appears with a slash thru the middle, as if denying access, any suggestions what to try next.  I have synced on this Ipod succesfully in the past, Suggestions?

    To drag and drop you have to use the Manual Method. That method is included here:
    iTunes: Syncing media content to iOS devices and iPod
    Was the iPod set up by wifi or setup or synced to another computer/iTunes library?

Maybe you are looking for