Sequence Last Number doesn't match with currval

Hi,
I have a sequence and i am using that in a procedure to insert records.Often the procedure throws error like primary key violated.
When i checked the last number used by the sequence it gave me as 27331 and the currval of the sequence as 27312.
Please advice us to rectify this.

746379 wrote:
Hi,
I have a sequence and i am using that in a procedure to insert records.Often the procedure throws error like primary key violated.
When i checked the last number used by the sequence it gave me as 27331 and the currval of the sequence as 27312.
Please advice us to rectify this.First make sure that you understand the difference between a primary key and a sequence.
A sequence is just a number generator. Oracle guarantees that the sequence will give you a new unique number each time that you call NEXTVAL. If the sequence is cycling then it can even generate the same number again after some time but this is rarely the case.
A primary key is a constaint on your table that requires all values in the column to be unique and not null.
When you get an primary key violated error then you just tried to insert a value that was already there in the table.
Some scenarios might be the reason for this.
<li>You insert a row using the sequence. You insert a new row using the same number again without fetching it from NEXTVAL (e.g. using currval instead of nextval, or not updating a variable that holds the new ID,...)</li>
<li>Somebody else already inserted an ID without using the sequence</li>
<li>A variation is when you import data from another database and resetted the sequences</li>
<li>There is some test data in your tables. The test data was inserted in a high ID range to separate it from the real data. Your sequence just reached this range.</li>

Similar Messages

  • HT1758 Are all Intel 24" iMacs w/Snow Leopard OK for Mountain Lion?  My serial number doesn't match any of the one in the iMac ID list; they all start with "MA" or "MB", mine starts with a "W." Purchased direct from Apple August 2007.

    Are all Intel 24" iMacs w/Snow Leopard OK for Mountain Lion?  My serial number doesn't match any of the one in the iMac ID list; they all start with "MA" or "MB" and mine starts with a "W." Purchased direct from Apple August 2007.

    Macs that can be upgraded to OS X Mountain Lion
    iMac (Mid 2007 or newer)
    MacBook (Late 2008 Aluminum, or Early 2009 or newer)
    MacBook Pro (Mid/Late 2007 or newer)
    MacBook Air (Late 2008 or newer)
    Mac mini (Early 2009 or newer)
    Mac Pro (Early 2008 or newer)
    Xserve (Early 2009)
    Open System Profiler and report what you find displayed for the Model Identifier.

  • Iphone 5 system serial no doesn't match with outer box? Case of misprint? i see only one latter is serial no doesn't match

    I recently bought iphone 5 32gb white. Was surprise to see the outer box serial no doesn't match with iphone 5 system.
    They have print XXXXXXTXXXX on box and on phone its XXXXXX7XXXXXX. Only one latter is mixprint though.
    I check coverage status at apple site. The box serieal no is not found in apple system while the iphone 5 inside serial no i can see warrenty.
    plz help is it normal to have serial no unmatched on phone and box or the phone is not genuine

    You are correct. The SIM Tray of iPhone 5 does not have the Serial #  printed on it. So your Serial # is the one in the Settings app About. This is your true Serial #. A 7 and a T from a box label are not distinct enough to matter. Apple will only honor the Settings About Serial # and the ones located inside the iPhone 5, which will be the same as the About Serial #.

  • Why my ipad warranty doesn't match with date that i bought? I bought ipad 4 yesterday but as you guys know it was already discontinued.. Has my ipad been used?

    Why my ipad warranty doesn't match with date that i bought? I bought ipad 4 yesterday but as you guys know it was already discontinued.. Has my ipad been used?
    I bought in 14 january 2014 and the expiration said it will be in 5 september 2014
    Is it mean that my ipad had been activated in 5 sept las year?
    But the packaging is good and it looks like very new.
    Please help me....
    I bought in IT plaza in kuala lumpur, malaysia..
    Heeellllppp...

    The merchant told me it is new. And when they opened the box and turn the ipad on, the ipad asked me to activate first.
    Is the 'restore to factory setting' can make us must activate the ipad again??

  • Serial number doesn't match product

    My coworker downloaded Adobe Acrobat XI Standard on our computers recently and now whenever I try to open up a PDF file a pop up screen appears with the heading "Serial Number Upgrade" asking me to chose a product and type in the serial number I have tried matching every single product option with my serial number and none of them work. The screen does say my serial number is correct but it doesn't match any of the products. I'm not sure what to do at this point...?

    Ok, so what you are saying is we bought the upgraded Adobe Acrobat, but we would need to buy the previous version if we want the serial number to work?
    King & Wood, P.A.
    1701 Hermitage Blvd., Ste. 104
    (850) 580-7711
    (850) 205-4501 fax
    Privileged & Confidential: This email is intended for the named recipient(s) only and may contain information that is proprietary, privileged, confidential, or otherwise legally exempt from disclosure. If you are not the named addressee, you are not authorized to read, print, retain, copy, or disseminate this message or any part of it. Nothing in this email is intended to constitute a waiver of any privilege or the confidentiality of this message. If you have received this email in error, please notify the sender immediately and delete this message. Circular 230 Disclosure:To ensure compliance with Treasury Department regulations, we advise you that, unless expressly indicated, any federal tax advice contained in this message or any attachments cannot be used for the purpose of avoiding penalties imposed by the Internal Revenue Code, or (ii) promoting, marketing, or recommending to another party any matters addressed herein

  • KE30 doesn't match with sales order gross and net prices of sales order

    KE30 for sales anlysis by sales document amounts are not matching with actual sales order..that too only for credit memo request type of documents,rest of other type of docs match...my controlling area in USD currency where as the sales documnets are created in canadian currency, report is being converted in mean conversion rate..all other documnets are matching, except credit memo request. Do you guys have any idea, where and what to to check? thanks

    Hi,
    Thanks but that is not a soluction. When the sales order is created by DP90, if there is a field mandatory the incompletion log should be activated as when you create the sales order by transaction VA01.
    It's clear that if you go out of the sales order created by DP90 without any change, the incompletion log doesn't active.
    Any idea o reason? Possibly I will send a oss note but I previously hope your considerations.
    Thanks in advance

  • Itunes will no longer accept any of my credit cards.  Says security code doesn't match with any card I use.  I have inputted new card info in the apple store area and it still says the same thing in itunes.  Customer service is no help at all.

    Itunes will no longer accept any of my credit cards.  It says vcode doesn't match when it does.  Customer service is no help.  I have re-inputted the info in the account section of the apple store and in itunes--still says vcode doesn't match.

    Itunes will no longer accept any of my credit cards.  It says vcode doesn't match when it does.  Customer service is no help.  I have re-inputted the info in the account section of the apple store and in itunes--still says vcode doesn't match.

  • Format-number doesn't work with XSL and DW preview

    Hi All
    I'm creating XSL files to transform XML into HTML. However,
    the number formatting doesn;t seem to work in Dreamweaver. For
    example, if I specifiy:
    format-number(price,'$###,###.00'), I should get $7596.99. I
    actually get 7596.990000000001 in my Preview (no currency symbol,
    too many decimal places). If I do the same thing in another XSL
    editor (Xseleerator) I get: $7,596.99.
    This is REAL PAIN, as every time I do anything with number
    formatting, I need to open the XML and XSL in another product just
    to check the formattng.
    Can anyone shed any light on this?
    Thnaks
    Mark

    Try to declare the variable out side of the region
    <script> var tp1;</script>
    <div spry region ... >
    tab panel stuff
    <script type="text/javascript">
    tp1 = new Spry.Widget.TabbedPanels("tp1");
    </script>
    </div>

  • Tabbed Panels: Opening panel with panel number doesn't work with Spry Data

    I have some data inside a TabbedPanelsContent div, and would
    like to be able to open tabs using links, but it only seems to work
    with static content.
    Clicking on tabs themselves loads content correctly, whereas
    clicking on links does nothing. I tried both - panel number and
    panel ID - neither worked. What gives?
    See code below.
    <div spry:region="ds1">
    <div class="TabbedPanels" id="tp1">
    <ul class="TabbedPanelsTabGroup">
    <li class="TabbedPanelsTab" tabindex="0">Asset
    Management</li>
    <li class="TabbedPanelsTab"
    tabindex="0">Brokerage</li>
    <li class="TabbedPanelsTab" tabindex="0">Mutual
    Funds</li>
    </ul>
    <div class="TabbedPanelsContentGroup">
    <div class="TabbedPanelsContent">
    <p spry:repeat="ds1"
    spry:test="'{@industry01}'.search(/^Asset Management/) !=
    -1;">{ds1::client}</p>
    </div>
    <div class="TabbedPanelsContent">
    <p spry:repeat="ds1"
    spry:test="'{@industry02}'.search(/^Brokerage/) !=
    -1;">{ds1::client}</p>
    </div>
    <div class="TabbedPanelsContent">
    <p spry:repeat="ds1"
    spry:test="'{@industry03}'.search(/^Mutual Funds/) !=
    -1;">{ds1::client}</p>
    </div>
    </div>
    </div>
    <script type="text/javascript">
    var tp1 = new Spry.Widget.TabbedPanels("tp1");
    </script>
    </div>
    <a href="#" onclick="tp1.showPanel(0); return
    false;">Asset Management</a>
    <a href="#" onclick="tp1.showPanel(1); return
    false;">Brokerage</a>
    <a href="#" onclick="tp1.showPanel(2); return
    false;">Mutual Funds</a>

    Try to declare the variable out side of the region
    <script> var tp1;</script>
    <div spry region ... >
    tab panel stuff
    <script type="text/javascript">
    tp1 = new Spry.Widget.TabbedPanels("tp1");
    </script>
    </div>

  • Cs4 serial number doesn't work with mavericks

    CS4 upgrade from  CS2 was installed on a mac running OS 10.9.2, the 30 day trial allowed photoshop to work, however, the serial number from the box does not work.  Everything seemed to work properly on the previous computer running 10.8

    There is a possibility the box is counterfeit - they do exist.
    Beyond that speculation, it's impossible for other users (like myself) to help you with serial number issues - you'll have to call Adobe customer support to resolve such issues.
    -Noel

  • Bios Machine Type number does not match with that recognized in Windows

    Hi.
    I found that my Thinkpad Machine type number is different to that recognized Lenovo's Solution Center and Windows's system infor.
    Serial number match but not the machine type number.
    Does anyone know why it is? 
    If I send my computer for warranty, does lenovo look at machine type number in Bios or in Windows or somewhere?
    Thanks

    I would not be concerned about what Windows reports.
    Does the tag on the bottom of the laptop match what you see in BIOS?
    Cheers,
    George
    In daily use: R60F, R500F, T61, T410
    Collecting dust: T60
    Enjoying retirement: A31p, T42p,
    Non-ThinkPads: Panasonic CF-31 & CF-52, HP 8760W
    Starting Thursday, 08/14/2014 I'll be away from the forums until further notice. Please do NOT send private messages since I won't be able to read them. Thank you.

  • Info cube data doesn't match with R3

    Hi,
    We are using "0AFMM_C02" Info cube for Inventory data.
    for some records its not fatching data for distribution channel.
    I checked the update routine for Distribution Channel.
    PROGRAM UPDATE_ROUTINE.
    $$ begin of global - insert your declaration only below this line  -
    TABLES: ...
    DATA:  BEGIN OF it_data OCCURS 0,
         material LIKE /bic/cs2af_mm_inv_1-material,
         plant LIKE /bic/cs2af_mm_inv_1-plant,
         val_type LIKE /bic/cs2af_mm_inv_1-val_type,
         END OF it_data.
    DATA: lt_mrpods TYPE TABLE OF /bic/ascm_d0500.
    INCLUDE rs_bct_retail_update_rules.
    $$ end of global - insert your declaration only before this line   -
    FORM compute_key_field
      TABLES   MONITOR STRUCTURE RSMONITOR "user defined monitoring
      USING    COMM_STRUCTURE LIKE /BIC/CS2AF_MM_INV_1
               RECORD_NO LIKE SY-TABIX
               RECORD_ALL LIKE SY-TABIX
               SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
      CHANGING RESULT LIKE /BI0/V0AFMM_C02T-DISTR_CHAN
               RETURNCODE LIKE SY-SUBRC
               ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
    $$ begin of routine - insert your code only below this line        -
    fill the internal table "MONITOR", to make monitor entries
    data:DISTR_CHAN LIKE /BI0/MCUST_SALES-DISTR_CHAN.
    SELECT SINGLE DISTR_CHAN INTO DISTR_CHAN FROM /BI0/MCUST_SALES
        WHERE CUST_SALES = COMM_STRUCTURE-CUST_SALES.
        IF SY-SUBRC EQ 0.
          RESULT = DISTR_CHAN.
        ELSE.
          RESULT = COMM_STRUCTURE-DISTR_CHAN.
        ENDIF.
    result value of the routine
    RESULT = .
    if the returncode is not equal zero, the result will not be updated
      RETURNCODE = 0.
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    $$ end of routine - insert your code only before this line         -
    ENDFORM.
    Can any body tell for what distribution channel it will get data..
    Please help .. its very urgent..
    Regards,
    Viren.

    Hi,
    I have a better suggestion..Try to write this code in Start Routine of Update Rule.
    DATA:  S_DATA TYPE STANDARD TABLE OF DATA_PACKAGE_STRUCTURE
           WITH HEADER LINE
           WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
    DATA:  ITEM_TABLE TYPE STANDARD TABLE OF /BI0/MCUST_SALES
           WITH HEADER LINE
           WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
    *start of modification
    *Populating the item status data from the item status ODS table
    SELECT * FROM  /BI0/MCUST_SALES INTO TABLE ITEM_TABLE.
    LOOP AT DATA_PACKAGE INTO S_DATA.
       LOOP AT ITEM_TABLE WHERE CUST_SALES = S_DATA-CUST_SALES.
         MOVE item_table-DISTR_CHAN to s_data-DISTR_CHAN.
         APPEND S_DATA.
       ENDLOOP.
    ENDLOOP.
    DATA_PACKAGE[] = S_DATA[].
    Hope this works...
    Regards,
    San!

  • How do i change the color of "Firefox" button on top-left? It just doesn't match with my favorite firefox personas.

    It is some kind of dark yellow and is very bright as it seems with some personas. Changing color should not be that big of a deal and i don't wanna download any themes.

    It is not straight forward but can be done. You can do this by adding code/scripts to a file called [http://kb.mozillazine.org/UserChrome.css userChrome.css] to change the appearance of the button. The Stylish add-on makes it easier to make the changes, the latest version of Stylish is available from http://forum.userstyles.org/discussion/24534/stylish-for-firefox-1.1b4
    For some samples of scripts you can add to Stylish to change the appearance of the button see http://www.neowin.net/forum/topic/921416-share-your-custom-firefoxminefield-4-stylish-scripts/
    There are also many scripts available at http://userstyles.org/
    Note that some scripts will no longer work as they would have been written for earlier beta versions of Firefox.

  • Serial number doesn't work with ps cs2

    how to reactivate my serial number without going to deativation page for instructions

    Error: Activation Server Unavailable | CS2, Acrobat 7, Audition 3

  • Why is My iPad (serial no. MD*******187) doesn't match with the chip inside, its A5x instead of A6?

    I just acquired this iPad with retina and I'm wondering about its specs so i search the internet using its serial no. MD*******187 model MD515ZP and i found out that its a fourth generation iPad with retina and has an A6 chip on it but when i downloaded an app namely battery doctor it has a feature on it (system) where you can see the hardware specification, from there i found out that the chip installed in my iPad is only A5x, I'm confuse please help. Thanks
    <Edited By Host>

    Clarissa111 wrote:
    Oh okay  thanks a lot for the information anyway do you know how i can see what chip was installed in my iPad?
    If you have a 4th gen iPad, it has an A6. No other chip is used on those models. If you absolutely must check it, try the app System Status. It has been updated to recognize the A6, but you will need to full (paid) version to see that data. The Lite (free) version does not have that screen.

Maybe you are looking for

  • Disabling default style (theme) at all

    Hi, I'm just starting using Flex 2. Is an interessant experience, as it blends many disciplines and skills. I'm demoing a demo for a project. The app has it's own style, so I linked the mxml file to an external CSS with style. The styles are applied

  • Regarding Non cumulative key figure

    Hi Friends, While we are doing Inventory mgmt we use three data sources. 1) 2LIS_02_BX -  why it is used? ( As far my knowledge is concerned This is Used to extract an opening stock balancce means when ever we are implementing the inventory for clien

  • Table Operator Vs Materialized View Operator

    Hi All, Could you please give the differences between Table Operator and Materialized view Operator in Oracle Warehouse Builder 11g. Regards, Subbu

  • Af:richtextEditor font-family- adding new font

    I am using af:richTextEditor in a web page. The font-family drop down inside af:richTextEditor components contains some font. I want to add some more font (e.g verdana,century etc) in that font-family drop down. Is it possible to add some extra fonts

  • Is any request number generates when i create a sap script??

    hi Gurus I want to know Is any request number generates when i create a sap script?? if it is generates then how to find that request number???