need to generate unique sequence for each transaction number

need to generate unique sequence for each transaction number

Use sometihng like that



use the orcl: sequence-next function val

Tags: Fusion Middleware

Similar Questions

  • Need to generate unique sequence number based on category

    Hello

    I have to update the NEW_NUMBER column with a unique number, taking into account the category column.

    Here is the table structure and data.

    {code}

    create table (sample)

    CATEGORY VARCHAR2 (100),

    NUMBER VARCHAR2 (100),

    NEW_NUMBER VARCHAR2 (100))

    {code}

    {code}

    insert into sample values ("CAPACITOR ', ' 36858'," ");

    insert into sample values ("CAPACITOR ', ' 37858'," ");

    insert into sample values ("CAPACITOR ', ' 36958'," ");

    Insert the sample values ('RÉSISTANCE', '46858', ");

    Insert the sample values ('RÉSISTANCE', '47858', ");

    Insert the sample values ('RÉSISTANCE', '46958', ");

    {code}

    I have to update the NEW_NUMBER column with a unique number, taking into account the category column.

    Output would be like that.

    {code}

    Insert in the values('CAPACITOR','36858','270-01-0000001') sample.

    Insert in the values('CAPACITOR','37858','270-01-0000002') sample.

    Insert in the values('CAPACITOR','36958','270-01-0000003') sample.

    Insert in the values('RESISTOR','46858','370-01-0000001') sample.

    Insert in the values('RESISTOR','47858','370-01-0000002') sample.

    Insert in the values('RESISTOR','46958','370-01-0000003') sample.

    {code}

    If you can help generate for one category, I'll do it for the other categories.

    Thanks in advance.

    Thank you

    LAK

    Not sure how you came up with 270 and 370. But with the information that you never provided that that's what I came with.

    SQL > select * sample;

    CATEGORY OLD_NUMBER NEW_NUMBER
    ---------- -------------------- --------------------
    CAPACITOR 36858
    CAPACITOR 37858
    CAPACITOR 36958
    RESISTANCE 46858
    RESISTANCE 47858
    RESISTANCE OF 46958

    6 selected lines.

    SQL > fusion in a sample
    2 using the)
    3. Select category
    4, old_number
    5, decode (category, "CAPACITOR ', ' 270', 'RÉSISTANCE', '370'")
    6                 || ' '-01 -.
    7                 || LPAD
    8                    (
    9 row_number() over (partition by order of category by old_number)
    10                     , 7
    11                     , '0'
    (12) new_number
    13 for example
    (14) b
    15 on)
    a.category 16 = b.category and
    17 a.old_number = b.old_number
    18        )
    19 when matched then
    20 update set a.new_number = b.new_number;

    6 lines merged.

    SQL > select * from sample by category, old_number;

    CATEGORY OLD_NUMBER NEW_NUMBER
    ---------- -------------------- --------------------
    CAPACITOR 36858 270-01-0000001
    CAPACITOR 36958 270-01-0000002
    CAPACITOR 37858 270-01-0000003
    RESISTANCE 46858 370-01-0000001
    RESISTANCE 46958 370-01-0000002
    RESISTANCE 47858 370-01-0000003

    6 selected lines.

  • sequencing for each case

    I have a two tables
    I appended a unique index on case_id and trn_id
    SQL> desc fm_move
     Name                          Null?    Type
     -----------------                -------- ------------
     CASE_ID                 NOT NULL NUMBER(9)
    TRN_ID                    NOT NULL NUMBER(9)
     SRC_EQ_NAME       NOT NULL VARCHAR2(40)
     DEST_EQ_NAME      NOT NULL VARCHAR2(40)
     STREAM_NAME                       VARCHAR2(32)
    SQL> desc pm_move
     Name                          Null?    Type
     -----------------                -------- ------------
     CASE_ID                 NOT NULL NUMBER(9)
     SRC_EQ_NAME       NOT NULL VARCHAR2(40)
     DEST_EQ_NAME      NOT NULL VARCHAR2(40)
     STREAM_NAME                       VARCHAR2(32)
    IAM need to insert data block pm_move table periodically
    for example:

    insert into fm_move(case_id,trn_id,src_eq_name,dest_eq_name,stream_name)
    Select case_id, * substitution *, src_eq_name, dest_eq_name, pm_move nom_flux;

    but I need to generate trn_id for fm_move table so that the insert operation. It should come in sequence for each case id,
    If the case_id changes then it must start from 1 and go...

    for example, the data should be like this
    case_id    trn_id
    1             1
    1             2
    1             3
    1            4
    2            1 
    2            2
    2             3
    
    .....
    so, how can I replace this sequence for trn_id in the fm_move table.

    Published by: Mohd Hussain of Claude on August 19, 2009 14:30

    Hi, I'm sorry, but I cannot reproduce:

    SQL> select * from t1;
    
       CASE_ID
    ----------
             1
             1
             1
             1
             1
             2
             2
             2
    
    8 rows selected.
    
    SQL> desc t2
     Name
     --------------------------------------------------------------------------------------------------
     CASE_ID
     TRN_ID                                                                                                 
    
    SQL> select* from t2;
    
    no rows selected
    
    SQL> insert into t2(case_id, trn_id)
      2  select case_id
      3  ,      row_number() over (partition by case_id order by case_id) trn_id
      4  from t1;
    
    8 rows created.
    
    SQL> select * from t2;
    
       CASE_ID     TRN_ID
    ---------- ----------
             1          1
             1          2
             1          3
             1          4
             1          5
             2          1
             2          2
             2          3
    
    8 rows selected.
    

    Thus, it works fine here (on 10.2)...
    What is your version of DB?

  • How to get LR using a unique name for each file?

    Hey there,

    I see that LR does not change the name of the file when there is already a file with the same name in the import file, but once you choose another folder it does not matter the file with the original name. I just realized that over the years using folders such as photos 2009 Photos 2010 and so forth, I have three or four times the files with the same name. Is there a way to tell LR to always use unique names when importing?

    Use a naming date-description model - sequence.ext to rename as you import (or if you prefer after importation). This means that you have never duplicates unless you for some weird reason use the same description for two sets of files on the same day. And if you need to do exactly that, just the starting number of the second/third batch of files be a number greater than previous batch on the same day.

    You can configure what ever format naming you want in file rename dialogue and have as a default.

    Leaving the file names as they come out of the device application in big trouble as invariably they're going to duplicate, which is not an even if good idea in different folders.

    F2 to rename the dialog when in the library.

  • Generating lines separated for each month in a date range

    Basically I have a row of data, for example:

    ID - start_date - end_date

    ------------------------------------

    XXA 1/23/14-3/12/14

    And I want to create a line for each month between the arguments start_date and end_date, for each ID, for example:

    ID - month - year

    --------------------------

    XXA January 2014

    XXA February 2014

    XXA March 2014

    What is the best and most effective way to do it? I thought using a slider, but once the table is created, I need to join the other than this one. I am new to oracle, and I don't know if you can join the other tables after completing a cursor and create a temporary table. Any help would be greatly appreciated.

    so... go with this:

    WITH DATA AS (SELECT "XXA' ID, DATE '2014-01-23' start_date, DATE' 2014-12-03' end_date FROM dual)

    UNION ALL

    SELECT "XX(B)' ID, DATE '2013-05-23' start_date, DATE' 2014-07-03' end_date dual FROM

    UNION ALL

    SELECT "XXC" ID, DATE '2012-01-23' start_date, DATE' 2013-12-03' end_date FROM dual)

    minmax AS (SELECT MIN (TRUNC(START_DATE,'Month')) AS minmon

    MAX (trunc(end_date,'Month')) AS maxmon

    DATA)

    , themons AS (SELECT add_months (minmon, LEVEL - 1) LIKE my)

    OF minmax

    CONNECT BY add_months (minmon, LEVEL - 1)<=>

    SELECT d.id, m.mon

    DATA d

    JOIN themons m ON (m.mon BETWEEN trunc(d.start_date,'Month') AND trunc (d.end_date, 'Month'))

    order by d.id, m.mon

    /

  • You need to install unique app for several identifiers without user intervention to make a first time sign in.  Can we encrypt the connection information in the installation

    In the old days of Volume License, we have just script the installation with a unique license for CLP licenses key.  Now, we have a different package for each simple installation with a different login id.  What happens if you make 10 or 100 with several identifiers

    Move this discussion to the enterprise deployment for Creative Cloud, forum of Creative Suite.

  • Need to display a field for each page

    Hi all.
    I'm trying to display a field <? job_no? > for each page of this work.
    I mean if I select job is between 1 and 10. for the number of Job 1, the data can be printed in one or more pages.
    But I need to show this job number (that you see with barcode fonts) in all the pages of this work.
    This work is under Group G_JOB. In general, I used as below
    <? for-each: G_JOB? >
    <? job_no? >
    < ?... ? >
    < ?... ? >
    < ?... ? >
    < ?... ? >
    < ?... ? >
    <? end foreach? >
    It's getting printed on the first page only. If I put it in the header of RTF file, it's ok, if I have chosen the number one job. But if I select for a number n of jobs is not posting.
    Help, please.
    Thanks Vasa.

    Vasa,

    Try this:

    
    
    
    
    
    

    The ' start: body "did everything that precedes a page header.

    Kurz

    Published by: Kurzweil4 on February 7, 2011 13:15

    added @section. This will reset the header for each job area.

  • Install the Acrobat batch - open password needs me to reenter passwords for each file?

    Hello

    I'm sure I'm missing something simple here, I use processing documents Acrobat pro 9.4.4 trying to set a password to open multiple PDFs that are freshly created from sources .docx (using Acrobat to create) a batch.

    Batch, I take command of security and define "encrypt all the contents of the document" and check the "require a password to open the document", then key the password (twice) and press OK. Then I run.

    I output all option to add as a prefix to the files so I know that he treats. When I run the batch sequence, it appears on password security - settings window, and if I just press OK and do not re-enter the password (twice), the new pdf is created without a password to open (he said 'Secured' on the title bar when it opens). If I get the password (twice) for each processed file, then I find myself with open passwords to work on PDF files. I can't understand what I'm doing wrong - any suggestions welcome!

    I use Windows XP Professional 5.1.2600.

    Thank you very much for reading, hope that you have some ideas to help.

    Peter

    You must change the mode of interactivity. See my responses on this thread:

    http://forums.Adobe.com/message/3703411

  • HOWTO generate a pulse for each Image Grabed?

    Hello

    I use a 7852DAQ card and a PCIe1429 framegrabber.

    In the momment I'm images grabing at 20 Hz with analog values PCIe1429 and measurement at 1 kHz with the 7852DAQ card.

    Now I would like to synchronize this measure two, I know what analog value is linked to my image.

    I think that the best way to get good timing is to generate a signal to each captured image. The best way of communication between the two cards should be triggering RTSI lines.

    With the IMAQ generate Pulse3 VI I was able to generate a continuous impulse signal a reading with DAQ card mit but this isn't what I want.

    Then I tried the Trigger IMAQ Drive2 VI.

    I did IMAQ Init and IMAQ create, IMAQ Grab Setup then the Trigger IMAQ Drive2 VI and then some time loop with IMAQ Grab acquire.

    My setup is Type of trigger "RTSI", number "0", trigger "Vertical sync Signal" drive and polarity of command high 'True '.

    My time loop has a 50ms in him waiting, so I should get a picture every 50ms and also get a pulse every 50ms. But this isn´t happenig. The pulses come about every second. When I use Trigger Drive 'Start Frame' I get the same behavior.

    So, what's the problem? I do not understand IMAQ Trigger Drive2 VI bad functionality?

    Thank you

    Hello Westgate,

    have you tried to use the player to trigger 'Start Frame' or 'Ongoing Acquisition' instead of 'vertical sync?

    In addition, you can check your FPGA code running on the R Series DAQ card: how you analyze the trigger in FPGA line, what is the interval of time to detect the pulse,...?

    Best regards
    Sebastian

  • Generate a sequence based on a number

    I have two tables... I want to generate the sequence 01, 02, etc., based on total_sections

    Table 1:
    CourseID Total_sections
    1 101
    1 102
    3 103
    2 104

    I would like to create a table based on the table above and the result should look like:

    CourseID Section_Num
    101 01
    102 01
    103 01
    103 02
    103 03
    104 01
    104 02

    How can I achieve this?

    And two more :)

    With 11g recursive subquery factoring:

    WITH t (course, number_of_sections, section_num) AS (
     SELECT course, number_of_sections, 1
     FROM your_table
     UNION ALL
     SELECT course, number_of_sections, section_num+1
     FROM t
     WHERE section_num < number_of_sections
    )
    SELECT course,
           to_char(section_num, '09') as section_num
    FROM t
    ;
    

    With a bit of XML:

    SELECT t.course,
           to_char(x.num,'09') as section_num
    FROM your_table t,
         XMLTable( '1 to xs:integer($n)'
                   passing t.number_of_sections as "n"
                   columns num for ordinality ) x
    ;
    
  • Creating a statue in gold that will generate random passwords for each deployment and how to recover passwords

    Hello

    New to 5.5 VDC and I hope that it is easy for you all the gurus.  After you create a statue in gold to say windows 2008 server and presentation in the public catalog how configure you to generate passwords random administrator when visitors in each of the ORG VDC wants to use it.  Now, I know you sysprep the OS in advance, and then when it starts, you can run the configuration wizard, or you can even define an answer file for things like the password key and administrator of the permit but y at - there a better way?  Having to go through the console and through a cloud of today technologies Assistant seems a bit old fashioned for me so I'm hoping its just something I missed narrowly in the configurations.

    The goal is simple... a customer deploys a VM and when it starts it is all ready to go so that no 2 VM This statue gold doesn't have the same credentials.  Somehow, they are provided with a generated random password to access the start new systems.  Amazon AWS for this using the keys if you deploy a virtual computer, you don't get invited to set a password... instead you can use your portal and get the password generated for you.  Their VM deployment and are ready to go without any additional configuration steps from the user at all.  How this is possible on a Director vcloud solution (or even at all).  I would like my customers to deploy from model, receive or access their new password and ready to go.  There may be a way to query the DB somehow and pull the password in this way?  And while I'm focused on windows operating system at the present time, it would be very happy to be able to do the same for root users on UNIX based as well as models.  Many big public cloud providers can provide their customers with this so I know there is a way but many also use things like openstack cloudstack or not vcloud Director.  Also I'm not familiar with the scripts so if you can get this kind of solution using scripts I'd appreciate some information or links that may describe step by step how to achieve and I will be happy to learn.  Thanks in advance

    UNIX systems are supposed to work.  And I know most the time they do.  (IE Redhat / Cent seems to work very well, however I have seen a few posts on this forum where a specific verion distribution may not work correctly.)

    Where to find the password.  Once the virtual machine boots (if the option to customize comments has been set at random) - the password will be on screen customization of comments; beside the selection of radio "Random."

    The API also has a way to get the password in case you need to expose in a different method.  (You can get it from section guestCustomize to a virtual computer in the restAPI thus).

  • Generate a key for each ip address authentication

    Hello

    I want to know if we can generate a key associated with each clients ip, with time as Wowza server limit...

    For more information, you can check here

    http://blog.wmspanel.com/2012/05/protecting-Wowza-from-re-publishing-re.html

    Can we do the same thing with Flash Media server for Rtmp streaming?

    Can not reach you even by properly modifying your action script logic for an AMS application server-side.

  • get the time for each transaction

    Hi Master,

    Someone asked me a question.

    I have a pl/sql block with multiple DML operations. How do you know how much time took each DML operation (not on a single table, tables different operations are underway in my pl/sql block)?  Like this

    Update statement

    INSERT statement

    Remove the statement

    I replied like that... Use dbms_utility.get_time... If each statement how long it takes... We can easily find...!  Once, he said... no I want to use predefined packages. DBA does not accept.

    How can I fix this... Masters?

    Please advise... !!!

    Concerning

    AR


    DBA will no longer accept pkgs installation... !!

    Create an account of RTO and defend his position to not use standard Oracle supplied packages, take the DBA.

    Therefore, these packages should already be installed.

    (Some essential element of the information seems to be missing).

    Since no valid rationale was given for this crazy requirement (IMHO), the correct solution may possibly be: replace your DBA.

    (I'd love to hear from experienced 'why' people, this requirement would be valid.)

    MK

  • Merge to PDF - create a unique name for each PDF file

    I have been regularly mail merge documents to PDF using Microsoft Word and Microsoft Excel for quite some time, but once I have a long list of PDF documents I then have to rename each to what it must be rather than 'PDFMailer123 '.

    Which would save me a lot of time with the renaming of the documents is so trying to create the PDF (with Adobe Acrobat), he was able to pick up a field in the worksheet excel information fusion to name the document.

    Is there a way to do this?

    Yes, it can be done if you do direct mail using a script.

  • Adobe Flash CS5 - need help animating a sentence for each word fades in separately

    I'm trying to do a simple clip.

    My goal is to have lyrics to the audio piece appear in sync.

    It doesn't seem to be a simple way to fade in (and on) each word individually which allows the alignment and sentencing position remains constant.

    Help, please.

    You can have anything you want to ask in the text with a mask. It will still work the same. Take a look at this example: http://www.ddg-designs.com/downloads/textMasking.zip

Maybe you are looking for