Updating Sequence based on type

I have a table with below structure and it has 1000's of rows.
Producttype Sequencenumber
1
2
3
1
2
3
4
5
I want to update sequencenumber column of all rows so that the sequence number starts from 1....n for each producttype.
I dont want Stored Procs. Can we do by SQL Query. ( Simple SQL and not using Analytical query )
Output should be as below
Producttype Sequencenumber
1 1
2 1
3 1
1 2
2 2
3 2
4 1
5 1
Thanks,
Bharani J
Edited by: user3745497 on Oct 20, 2010 12:29 PM
Edited by: user3745497 on Oct 20, 2010 12:30 PM

there must be a another connection between the records that you want to update with same seq no
Producttype Sequencenumber
1 1
2 2
3 1
1 2
2 1
3 2
4 2
5 1
it could be like that too, there must be connection.

Similar Messages

  • Update All Sequence files automatically (Types)

    We have a very large number of sequence files that need to be updated.  The "Types" have changed.
    Is there a way to have TestStand (2010 f1) update all the files in a Directory, or hopefully recursively?
    What I'm used to doing is to check all the files out of our Version Control, select about 20 files at a time and open them in TestStand, Save them all and then close them, then do another set...
    Is there a faster way?  (I would expect to check them out of Version Control.)
    Mike
    Solved!
    Go to Solution.

    Take a look at the Sequence File Converter located at Tools >> Update Sequence Files
    CTA, CLA, MTFBWY

  • Getting Sequence object from pre-step substep of Sequence Call based step type

    How to obtain reference to Sequence object from within pre-step substep of Sequence Call based custom step type?
    Given: new custom step type which based on NI Sequence Call step type. There is Pre-Step substep exist for this step type.
    How to get reference to Sequence object representing Sequence which will run?
    Although there is possible to examine SequenceAdapter and SequenceCallModule properties, it seems redundant since module (Sequence) is already loaded by TestStand ("NI TestStand Reference Manual. Table 3-4. Order of Actions that a Step Performs"   Action #6, while my code is running as Action #13).
    Thanks.
    Misha

    Could you explain what you want to do ?
    Why do you want to get the sequence object within a pre-step substep ?
    I give you some informations but I don't know if it's the better way to do what you want (because I don't know what you want to do with the sequence object).
    If the substep uses the ActiveX adapter :
    You can get the sequence object but you should save the object reference in a StationGlobals variable.
    And you should release the object reference within your sequence when you don't need it any more.
    If the substep uses another module adapter: 
    Get the step module, then the sequence name (module property).
    Then get the sequence object by the sequence name from the sequence file.
    Here are the paths to use for both methods :
    Sequence Name property path : Step.Module.SeqName
    Sequence Object path : RunState.SequenceFile.GetSequenceByName (seqname)

  • Update JSP based upon change in database

    Hello JSF gurus,
    Is it possible for a JSP to update based upon a change in a database? For example, say a new row gets added to a table. Can this be detected and somehow result in a notification being sent back to the JSP (or its backing bean), causing a refresh? Thanks.
    -Robert

    In fact, I guess that I could ask an even more general question: can a JSP be updated "programmatically" (a push type model), or does it require a request (i.e. some user interaction) generated on the JSP (a pull type model).

  • Know steps names of called sequence file using sequence call step type in TestStand

    Hi,
        I have a problem in accessing step names in called sequence file using "Sequence call"step type in TestStand 4.0.
    I would list out all step names of called sequence file. Is it possible to do through C#.NET? If, yes, Please explain to me in detail with possible example.
    Thank you,
    regards
    RKK

    Hey RKK,
    I want to first set your expectations for the forums.  This is not a place for people to review and rewrite your code for you; this is a place for specific and general questions.  I am not saying your question in this thread is inappropriate, because it is a good questions.  We should just not post code and ask others to fix it here.  If you are looking for this type of service we have alliance members that can help you write your TestStand Operator Interface (www.ni.com/alliance).
    As for you question about getting the sequence names for a sequence file that is not the currently running sequence file, you will need to open a reference to that sequence files and then use the API calls that I mentioned in my previous posts.  You can use the Enigine.GetSequenceFileEx function to open a reference to sequence file, and you will need to close the reference with the Engine.ReleaseSequenceFile function when you are done using it.  After you have a reference to this external Sequence File, you can use the example dll and sequence I previously sent you.  I also attach a new sequence file (SeqFile2.seq) plus an updated GetNames.seq to illustrate how to use the above mentioned functions.  I hope this helps.  Have a great day!
    Best Regards,
    Software Engineer
    Jett R
    Attachments:
    GetNamesOfSequencesInFile.zip ‏52 KB

  • BC4J Custom API: Batch Validation with Sequence-based primary key

    Hi people,
    I am trying to create a BC4J Custom API using the Batch Validation feature of iSetup Framework. However, my entity object has a sequence-based primary key, and this key is carried to the View Object. This way, i have three attributes marked as key attributes in the VO: InvoiceTypeId (the sequence), OrganizationId and InvoiceTypeCode (The alternate, developer key). the primary key is marked AZ_EXPORTABLE=FALSE, because it must be rebuilt in the target using the alternate key.
    I was able to successfully extract a single row to XML using this API (i am testing locally). When i try to import this XML file containing a single row, i get the following exception. Is this feature supported in Batch Validation mode?
    Regards
    Thiago Souza
    ** Exception starts **
    Started import...
    An exception occurred in API 'CLL Invoice Types'.
    oracle.apps.fnd.framework.OAException: An exception occurred in API 'CLL Invoice Types'.
         at oracle.apps.az.fwk.BEUtil.wrapperException(BEUtil.java:395)
         at oracle.apps.az.fwk.server.BEImport.populateTempTableForBatchValidation(BEImport.java:1927)
         at oracle.apps.az.fwk.server.BEImport.importXML(BEImport.java:371)
         at oracle.apps.az.fwk.server.BEApplicationModuleImpl.importFromXML(BEApplicationModuleImpl.java:404)
         at R12APITester.importFile(R12APITester.java:205)
         at R12APITester.importFile(R12APITester.java:180)
         at R12APITester.main(R12APITester.java:65)
    ## Detail 0 ##
    oracle.apps.fnd.framework.OAException: java.sql.SQLException: ORA-06550: line 32, column 29:
    PL/SQL: ORA-00904: "KEY31": invalid identifier
    ORA-06550: linha 32, coluna 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: linha 33, coluna 29:
    PL/SQL: ORA-00904: "KEY32": invalid identifier
    ORA-06550: linha 33, coluna 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: linha 34, coluna 29:
    PL/SQL: ORA-00904: "KEY33": invalid identifier
    ORA-06550: linha 34, coluna 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: linha 35, coluna 29:
    PL/SQL: ORA-00904: "KEY34": invalid identifier
    ORA-06550: linha 35, coluna 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: linha 36, coluna 29:
    PL/SQL: ORA-00904: "KEY35": invalid identifier
    ORA-06550: linha 36, coluna 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: linha 37, coluna 29:
    PL/SQL: ORA-00904: "KEY36": invalid identifier
    ORA-06550: linha 37, coluna 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: linha 38, coluna 29:
    PL/SQL: ORA-00904: "KEY37": invalid identifier
    ORA-06550: linha 38, coluna 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: linha 39, coluna 29:
    PL/SQL: ORA-00904: "KEY38": invalid identifier
    ORA-06550: linha 39, coluna 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: linha 40, coluna 29:
    PL/SQL: ORA-00904: "KEY39": invalid identifier
    ORA-06550: linha 40, coluna 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: linha 41, coluna 29:
    PL/SQL: ORA-00904: "KEY40": invalid identifier
    ORA-06550: linha 41, coluna 1:
    PL/SQL: SQL Statement ignored
         at oracle.apps.fnd.framework.OAException.wrapperException(Unknown Source)
         at oracle.apps.az.fwk.server.BEValidationXMLParser.executeSql(BEValidationXMLParser.java:288)
         at oracle.apps.az.fwk.server.BEValidationXMLParser.collectUKFKValues(BEValidationXMLParser.java:254)
         at oracle.apps.az.fwk.server.BEImport.populateTempTableForBatchValidation(BEImport.java:1897)
         at oracle.apps.az.fwk.server.BEImport.importXML(BEImport.java:371)
         at oracle.apps.az.fwk.server.BEApplicationModuleImpl.importFromXML(BEApplicationModuleImpl.java:404)
         at R12APITester.importFile(R12APITester.java:205)
         at R12APITester.importFile(R12APITester.java:180)
         at R12APITester.main(R12APITester.java:65)

    Hi Thiago,
    I would suggest to test your API first with row by row validation mode where you would be resolving the foreign and primary keys as specified in the framework. This would help you to understand the framework better and once it starts working for you and then you can try with batch validation mode.
    Thanks
    Mugunthan.

  • Automatic update sequence files

    Hi all,
    we have a simple step type, which will be usen in some hundreds of small sequence files.
    We have changed the step type, as we added some variables, and in the Specify Module dialog we have defined the variabla-table new.
    Now we want to update all the sequence files automatic. In the "Tools menu -> Update sequence files" there is a possibility, but it adds only the new variables to each instance of the step type, and doesn´t update the table, which we changed in the Specify Module tabe in the step type editor. If we open the updated file again, and go to Specify Module on an instance of the step type, we get the message "The prototype of the VI changed. The parameter information wil be updated to reflect the new prototype." 
    But the changes, what we have done in the Step Type editor, are not done to the instance.
    The question is: how to update the step types?
    regards
    MB

    Best way ist search for StepTypes Parameter in whole sequence (file(s)) and then set it explicit e.g. with Statement (see Screenshot)
    RunState.Sequence.Main["Action"].TS.SData.ViCall.Parms 
    e.g. RunState.Sequence.Main["Action"].TS.SData.ViCall.Parms["Sequence Context"].ArgVal="Locals.Test123"
    Attachments:
    TSstatementTypes.doc ‏152 KB

  • How to create a sequence based on name, country, city, year, month, number

    Hello,
    I am using Application Express 4.2.1.00.08
    I am new to apex and i need some help in creating a sequence.
    I am creating an application where i profile people and i need to create an auto sequence that when the person is added to the database he will have his own sequence based on his name, country, city, year he was added, month he was added and his number.
    This is a bit tricky because each person will have a different name, country city etc.
    How can this be done ?

    Hello,
    I have to create a sequence so that when for example an employee is added using a form his ID will be saved based on his name, country, city, year he was created, month he was created and his number.
    However, each employee is diff, so when you add another employee to the form his ID will be different, different name, country, city etc..
    This has to be automatically generated.. is this possible?

  • My video i have successfully worked on for seven days now won't open at all.  It says there is no sequence of this type found... But in the very bottom bar I can see the whole project load.  But the only option from the error screen is exit out of Premier

    My video i have successfully worked on for seven days now won't open at all.  It says there is no sequence of this type found... But in the very bottom bar I can see the whole project load.  But the only option from the error screen is exit out of Premiere Pro CC.  I am on a PC withe Windows 8.1 and apps are up to date.  Thanks much for any help!!

    Hi Bryan,
    My video i have successfully worked on for seven days now won't open at all.  It says there is no sequence of this type found... But in the very bottom bar I can see the whole project load.  But the only option from the error screen is exit out of Premiere Pro CC.  I am on a PC withe Windows 8.1 and apps are up to date.  Thanks much for any help!!
    Sounds like an activation issue. Quite Premiere Pro. Sign out of Creative Cloud. Restart Premiere Pro. Sign back in: http://bit.ly/CC-sign-out
    Hope that works for you.
    Kevin

  • Error while updating to target 0PUR_C01 (type INFOCUBE)

    Dear Friends
    I am facing the problem while loading data through DTP from PSA to cube(Target).Problem occurring is at 0FISCPER.
    The error shown is as below:
    Data Package 2: Errors During Processing  >>> Updating to InfoCube 0PUR_C01 >>
    Error while updating to target 0PUR_C01 (type INFOCUBE)
    Messages for 101 data records saved; request is red acc. to configuration
    Processing Terminated
    display for error records: No fiscal year variant specified
    DTP request location:
    Error Location: Operation Type: VAL_SID_CONVERT
    Error Location: Operation Name: 0FISCPER
    please give me helpful suggestion. I m w8ing for ur reply. I need ur needful comments.

    Yes it is direct mapping with Entry date (SYDAT). But how should i solve this problem.
    In PSA, for that Entry date giving the values:
    11.02.2009
    12.02.2009
    13.02.2009
    14.02.2009
    16.02.2009
    17.02.2009
    18.02.2009
    21.02.2009
    23.02.2009
    25.02.2009
    03.03.2009
    05.03.2009

  • Movement type 122 Error while GI" Update control of movement type is incorr

    Hai Gurus,
             I am having an errow when doing a GI thru movement type 122. i am getting this error message " Update control of movement type is incorrect (entry 122 X X)" Can any one help me how to fix this.
    I did this transaction using MIGO_GI and selecting Goods issued and other as the options with 122 as movement type.
    warm regards.
    mahesh.

    Hi
    Mov type 122 is return to vendor if the qualtiy of Goods  is Poor / Quality
    Regatds
    AKM

  • Update control of movement type is incorrect

    while planning for a material with mrp type pd and strategy group as 20(make to order) i created a customer requirement against which after running mrp the tran md04 showed purchase req for a particular material which was released by me and converted into purchase order by me.
    but when I wanted to do goods receipt against the po generated it is giving me this error in tranc migo.
    ERROR IS     "update control of movement type is incorrect entry (101 X X e b _ v)
    the performance assist screen shows this
    Update control of movement type is incorrect (entry 101 X X E B _ V)
    Message no. M7226
    Diagnosis
    The system could not find entry 101 X X E B _ V in any of the movement type control tables.
    Procedure
    Cancel current processing.
    Contact your system administrator.
    Action to be taken by the system administrator
    Check in Customizing for Inventory Management under Copy, Change Movement Types whether the entry is contained in the Update control view for the movement type.
    If the entry is missing, proceed as follows:
    For standard movement types, this means that the given process is not supported using the present data combination. Do not create any entries without prior arrangement with your SAP consultant. Otherwise, incorrect postings may result.
    For customer-defined movement types (beginning with 9, X, Y, or Z), this may mean that they have not been fully defined. Delete the movement type and re-create it by copying a standard movement type.

    Hi
    Check the T code OMJJ for the defining the MVt type also check the error is coming for MVT type 101 then check with mvt type 101 in t code OMJJ and check the updation control there.
    also consult your MM consultant for this error
    Regards
    Anupam Sharma

  • Update control of movement type incorrect

    Dear all,
    I have run a complete sales cycle from sales order creation to excise invoice generation. However, I have not done the PGI since in our case it is done after the billing. The materials have been dispatched and excise invoice submitted.
    Now, when I am doing PGI it is throwing an error "Update control of movement type incorrect (entry 601 _ X Q L _ V) ". I analysed and found that I have wrongly filled the Requirement Type in the sales order and corresponding entry is missing in OMJJ.
    1- I tried to add this entry but in vain. There is no 'New entry' or 'Copy as' button and hence i could not add..
    2- So, I tried the other alternative i.e. reversing all the documents and changing the RqTy in order. But that can't be done since excise has been sent.
    Is there any other way by which I can do the PGI or atleast capture the goods movement in the system and also update all the relevant documents?
    Plz guide.
    Thanks
    SAPshed

    To do the PGI / PGR , you have to cancel the Excise Invoice through J1IIN and then the Billing Document.Only after this , you can do the PGR or PGI.
    Best Regards,
    Ankur

  • Quantity based condition type for excise duty  calculation in tax procedure

    Hi,
    If any one has worked on the issue of excise duty  calculation on Quantity of items purchased Quantity based condition type.
    [<b>For a formula based calculation procedure TAXAU]</b>
    Example : If quantity purchased = 10 units
              Duty to be calculated @ Rs.3 per unit
              Duty on the 10 units = Rs.30
    Other than SAP Note 816835 any help is appreciable.
    Thanks a lot,
    Uma
    Message was edited by: Uma

    I could not find this condition type/Tcode  in our client system.
    Even we are on 4.6c.
    Thanks,
    Message was edited by: Uma

  • ADF BC: Creating updatable VO based upon DB View with "instead of" trigger

    Hello all,
    I have got an interesting issue. I have an Oracle DB view that is used to hide some complexity in the underlying DB design (it does some unions). This view is updatable because we have created an "instead of" update trigger to update the correct table when a row is updated. This is working fine in SQL.
    Next, we have created an ADF Entity object based upon the view, specifying an appropriate PK for the DB View. Then, we have created an updatable VO based upon the EO. All well and good so far. The issue we have is in trying to commit changes to the DB - because the ADF BC framework is trying to lock the row to update (using SELECT ... FOR UPDATE), it's not working because of ORA-02014 - cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc.
    This leads me to thinking about overridding doSelect() on the EO as hinted here http://radio.weblogs.com/0118231/stories/2005/07/28/differenceBetweenViewObjectSelectAndEntityDoselectMethod.html
    As a temporary test, we have over-ridden the EO's doSelect to call super.doSelect(false) and it does work, although we will have lost update issues as detailed in Steve's article.
    My questions:
    1). Is overriding doSelect() the correct thing here? Perhaps there is a better way of handling this problem? I do have a base EO class from which all of the EO's extend, so adding this behavior should be straightforward.
    2). Does anyone have example doSelect implementation? I am thinking of overriding doSelect for my EO and calling super.doSelect (lock=false), but then I need to deal with some possible exceptions, no?
    Kind regards,
    John

    Hi John,
    I have exactly the same issue as you experienced back in January. I have a complex data modelling requirement which requires the need to pivot rows into columns using ROW_NUMBER() and PARTITION clauses. To hide the complexity from the middle tier, I have created a database view and appropriate INSTEAD OF triggers and mapped my EO to the view. I have overriden the lock() method on the EO implementation class (to avoid ORA-02014) and would like to try the same solution you used with the pl/sql call to lock the record.
    My question is, how did you manage the release of the lock if the transaction was not rolled back or committed by your application i.e. if the user closed the browser for instance.
    In my naivity, I would like to think that the BC4J framework would release any locks for the database session when it found the servlet session to be terminated however my concern is that the lock would persist and cause complications.
    Any assistance greatly appreciated (if you would be willing to supply your lock() method and pl/sql procedure logic I would be even more grateful!).
    Many thanks,
    Dave
    London

Maybe you are looking for

  • Ipod wont show up in itunes after installing update

    okay so i hadn't updated my ipod in a couple of months (bad i know but we have really slow internet here and it takes forever to download things) then i downloaded the update a couple of days ago and it started installing then came up with an error s

  • IPhoto crashes with the Cloud

    When I turn on Photo Stream in my iPhoto it crashes.  Everything else works with the Cloud / my iPhone / my MacBook Pro except iPhoto.  Do I just wait for Apple to send out updates to eliminate this problem? This problem started when I connected to t

  • Ftp in unix shell script

    hi. I have the following requirement to be written as a shell script. 1. ftp to another server ( say x) 2. change the directory ( cd /data) 3. check if there exists a file with extention .csv. If it does, 3.1 get the file and copy it to a backup dire

  • How to get Custom Time Correction business logic implement for ESS in R/3?

    Hi Experts, I am in trouble of implementing the custom requirement of correcting the time in ESS. I have to implement the time corrections as per business logic. Can any body tell me where to do this? What I need is suppose employee DWS is from 9:30

  • Does anyone know what time the last episode of Breaking Bad starts streaming

    Deos anyone know what time the last episode of Breaking Bad starts streaming on itunes?