How to set a seq lines separate numbers.

I have trouble to find this one. I don't really understand how I would give the same number of seq for same CUSTOMER_CODE.
CUSTOMER_CODE
         M134
          424
         M134
          241
         M204
         M204
         M204
So the end result, I would have it...
CUSTOMER_CODE CUSTOMER_SEQ
         M134         1001
          424         1002
         M134         1001
          241         1003
         M204         1004
         M204         1004
         M204         1004
Here my request im working on... no idea how I would add the increment and keep track of it...
Update CUSTOMER
set CUSTOMER_SEQ = (1000 + i)
FROM CUSTOMER_CODE = (SELECT distinct(CUSTOMER_CODE) 
                                       FROM CUSTOMER)

Use MERGE:

SQL> select * from customer
  2  /

CUST CUSTOMER_SEQ
---- ------------
M134
424
M134
241
M204
M204
M204

7 rows selected.

SQL> merge
  2    into customer a
  3    using (
  4           select  customer_code,
  5                   1000 + row_number() over(order by customer_code) customer_seq
  6             from  customer
  7             group by customer_code
  8          ) b
  9    on (b.customer_code = a.customer_code)
 10    when matched
 11      then
 12        update
 13           set a.customer_seq = b.customer_seq
 14  /

7 rows merged.

SQL> select * from customer
  2  /

CUST CUSTOMER_SEQ
---- ------------
M134         1003
424          1002
M134         1003
241          1001
M204         1004
M204         1004
M204         1004

7 rows selected.

SQL> 

SY.

Tags: Database

Similar Questions

  • How to set a seq.currval in ODI 12 c?

    How can I set the seq.currval in the column of ODI. When I use table.seq.currval in the table is the expression in ODI shows this error java.sql.SQLException: ORA-08002: sequence GL_SEQ. CURRVAL is not yet defined in this session... Can someone help me please?

    Not so much a question of ODI, but an Oracle DB one.

    You must use NEXTVAL on the sequence of initialization CURRVAL in your session - CURRVAL only works after a NEXTVAL

  • How to set up single-line message headers?

    Previously, in the message display area, I had configured Thunderbird so that a message appears that the subject of the message in the message header section just above the body of the message. But I just upgraded to to 38.1.0 and now I have in reserve, [address], in the header box, although I've seen-> headers-> Normal (Compact) set.

    Please tell us how to get back to the option just to display the subject line. Real estate vertical display is much too precious to not having the capacity of the old view of a single line.

    Thank you
    [email protected]

    Install this add on.

    https://addons.Mozilla.org/en-us/Thunderbird/addon/compactheader/?src=HP-DL-featured

    The normal headers view removes the routing information only. It has nothing to do with what you are trying to accomplish.

  • How to set the entire line to be active?

    Hello guys, I wanted to know if there is a way to define the line with all its elements to be active at a time.

    i.e. If a line contains a title, a text and an image, aligned horizontally next to each other, what I want is clickong on one of them all will focus on the line.

    and thank you

    Hi you can use listfield or see this link

    http://StackOverflow.com/questions/1872160/how-to-customize-a-list-field-in-BlackBerry

    Thank you.

  • How to set the content of the column for lines of automatic separation

    Hello guys,.

    I have a problem with the column width and the content of column in a standard report. In the report are hugh entries that are not interrupted by a space character. I put my column width to a special value by usingen "style css: display block; Width: 300px; ». Now the problem is that some of the entries in the column with a longer width that the column width is set. Then they overlock the entries in the column next to them.

    My question is: How to set the column lines of automatic content break after a certain number of characters?

    After searching for a couple of websites and discussion thread, I found maybe a reference to the solution. I hope that it helps you to give me an answer.

    A4 FORMAT LAST_NAME COLUMN
    */*

    concerning

    wderr

    Wderr,

    It is more a matter of HTML as a matter of APEX... You can start by looking here:
    http://www.456bereastreet.com/archive/200704/how_to_prevent_html_tables_from_becoming_too_wide/

    Kind regards
    Dan

    Blog: http://DanielMcGhan.us/
    Work: http://SkillBuilders.com/

  • How to set the 1st online number = 10 and increment 10 whenever you press the button to add a new line. Also enable users to enter the generic numbers, IE 13 and still increment of 10 23 or whatever.

    How to set the 1st online number = 10 and increment 10 whenever you press the button to add a new line. Also enable users to enter the generic numbers, IE 13 and still increment of 10 23 or whatever.

    I already have my chart updated in place with a button that will add new lines when pressed.

    Now, I want to clarify that the 1st row is 10 and all the other rows after this increase by 10. It will also allow users to enter any number they want, and the next line will increment of 10.

    Help please.

    Try changing the line button Add the following JavaScript code

    newRow var = Table1._Row1.addInstance)

    If (newRow.index > 0)

    {

    newRow.NumericField1.rawValue = newRow.resolveNode ('Row1 [-1].) NumericField1') .rawValue + 10;

    }

    You need to change this code to match your name on the form, but basically the method addInstance() returns the new row, the newRow.resolveNode ("Row1 [-1]... will get the value of the previous row and then add 10.

    Concerning

    Bruce

  • How to set the default value of the attribute with a sequence number? Is it possible to add a string to seq.no. like abc0001?

    Mr President.

    How to set the default value of the attribute with a sequence number? Is it possible to add a string to seq.no. like abc0001?

    Concerning

    For the date, you can use groovy expression adf.currentDate to set the current date. reference http://adfgouravtkiet.blogspot.in/2012/11/how-to-set-default-values-for-entity.html

    You already have ways to use the sequence.

    How do you add a new value in the form. You're creating a new line of your page (user interface) and by engaging with validation operation? Unless you commit you will not be able to see anything in the table.

    Thank you

  • How can I add a continuous line of numbering in documents using Pages?

    I need to put the line numbers for each line in a document that I am preparing for the presentation of a newspaper. How can I make continuous line, numbering of Pages automatically?

    Pages can't do because it is not a TextEditor with a fixed number of characters per line, and there linewrap.

    Use a TextEditor like iText Express or iText Pro or similar.

    Peter

  • How to set up the PFI lines as input to PXI-6713 module

    Hello

    I have 6713 PXI module in my chassis PXI-1044. I have configured the PXI-6713 module to geneate some analog signals to my Board of Directors.

    Council inturn process this analog signal and answers in return the status signals through a registry to the Board of Directors. In my application, the status bits in the register state of the governing body are mapped on the PFI 0:3 bits of the PXI-6713 (pins 11,10, 42 and 43) module.

    My query is how can I configuration lines PFI as 6713 PXI module entries to read these status bits?

    May be less than the explanation could give you little more information w.r.to my request.

    When I use NI USB - 6008 module to read the same bits, because this unit has 12 e / s digital, I was able able to read the status bits in the last 4 digital lines by setting up those digital lines as input.

    In the PXI-6713 module, I have only 8 digital lines. These 8 digital lines I used to send digital signals to the Board of Directors. I find myself with no digital i/o. Therefore, I could not use these digital lines. I'm left with only one option to use. Joana re PFI lines. Also the bits of status in the axis of the room are mapped such that the bits can be read through the PFI lines.

    I was wondering do we have any example code to use inorder to read these status bits to the Board of Directors using the PFI lines.

    Please let me know if you need more information to help out me.

    Thank you.

    Hello

    When using the PFI PIN as input, you can individually configure each PFI for edge detection or level and the selection of the polarity.  This information of PFI are referenced in the manual of Series DAQ Analog Output on page 6-1 (http://www.ni.com/pdf/manuals/370735e.pdf).  Unfortunately, the PXI-6713 PFI lines are able to time a signal input and output for functions, AO or counters/timers.  The ability to create static DI of the PFI lines is not available for the PXI-6713. However, some cards have this capability.  The latest National Instruments products with PFI lines have the option of setting as PFI lines:

    1. Static digital input
    2. Static digital output
    3. Input signal of sync for functions HAVE, AO, DI, or counters/timers
    4. Output signal of the calendar functions HAVE, AO, DI, or counters/timers
      (http://digital.ni.com/public.nsf/allkb/14F20D79C649F8CD86256FBE005C2BC4)

    When the static value such as DIO, PFI lines are assigned to a different port (for example. PFI0-7 is Port1).  More details on this subject can be referenced at:

    http://digital.NI.com/public.nsf/allkb/DA2D3CD0B8E8EE2A8625752F007596E1

    http://digital.NI.com/public.nsf/allkb/862567530005F09E8625677800577C27

  • ISA500: How to set up a second WAN-IP-Range on the same line WAN?

    I have an ISA570 and my ISP put the additional IP range on the same WAN line as the existing one. How to set this up? Best regards and thank you very much Jens

    Hi @jens.leipziger @....

    But the ISP just incremented the mask of your stove or put a completely different extra range?

    In the case that he attributed to a different subnet, you cannot configure the ISA with a range of IPS 'secondary '.

    You can do with Cisco routers and L3 switches with the "Ip address x.x.x.x secondary"command configuration from the interface."

    See the following link for more information about the configuration of ISA:

    http://www.Cisco.com/c/en/us/TD/docs/security/small_business_security/is...

    Do not forget to rate

    Rgrds,

    Martin, computer scientist

  • How can I change my code the method to set a specific line id in my lov as a default?

    Mr President.

    How can I change my code the method to set a specific line id in my lov as a default value instead of the first value?

        public String defaultDebit() {
    
    
           String debit = (String)getAttributeInternal(DEBIT);
           if (debit == null) {
              COAViewRowImpl coaRow = (COAViewRowImpl)getDebitView1().first();
              if (coaRow != null) {
                 debit = coaRow.getAcctId();
              }
           }
           return debit;
        }
    

    Concerning

    You can see the below example code. This code assumes a view attribute named AcctName and the code returns the AcctId when the AcctName is DEFAULT_DEBIT.

    public String defaultDebit() {}

    String output = (String) getAttributeInternal (DEBIT);
    If (flow == null) {}
    getDebitView1 (.reset ());
    While (getDebitView1 () .hasNext ()) {}
    COAViewRowImpl coaRow = (COAViewRowImpl) getDebitView1 () .next ();
    If (coaRow! = null) {}
    If (coaRow.getAcctName () .equals ("DEFAULT_DEBIT"))
    flow = coaRow.getAcctId ();
    }
    }
    }
    return flow;
    }

    Let us know if this does not work in your case.

    Thank you

  • How to set the line current

    Dear all,

    I have a panelFormLayout with some fields on this and there are other hidden required fields I want to put values in the button submit, I'm here links but I don't know how to set the current row programmatically.

    Thanks in advance.

    Hello

    You could do something like this:

    Binding DCIteratorBinding = ADFUtils.findIterator ("EmployeesView1Iterator");

    Line currentRow = binding.getCurrentRow ();

    currentRow.setAttribute (attrName, "attrValue");

    Concerning

    PS:

    public static DCIteratorBinding findIterator (String name) {}

    DCIteratorBinding iter =

    getDCBindingContainer () .findIteratorBinding (name);

    If (iter == null) {}

    throw new IteratorNotFound ("iterator '" + name + "' not found");

    }

    Return to iter;

    }

  • How selectBooleanCheckbox can set the current line?

    Hello

    Using ADF Faces 10 g, I have an af:table component that is read-only, but the last column contains an af:selectBooleanCheckbox. This checkbox is used to 'activate' and 'disable' to each line. When I click on the box, I need the valueChangeListener be aware which line has been activated (so that I can then make some changes on this line to toggle). By clicking on the box to check must call setCurrentRow, or at least pass on values I can use later to set the current line manually.

    My first thought was setActionListener, but it seems that it may not be combined with af:selectBooleanCheckbox. I searched and found the following post:
    HOW to set an ID for the component from variable
    and after reading this I tried setPropertyListener, once again, I found that this is not a valid child of af: selectBooleanCheckbox. The post dry with nuansantio mentioning several times that setActionListener and setPropertyListener cannot be used, but there is no other comments on a solution.

    Any thoughts on how I can get this to work?

    Hello

    Could you elaborate more about

    I need to make a number of manual steps (invoking request Module) when the user selects / disables the check box

    You can pretty much add a method in your Impl VO (who did all the steps you want to do) and call the method in an expression for the value of groovy / call it in valueChangedListener of the box?

    Arun-

  • How to develop and reduce lines or groups of lines in figures?

    How to develop and reduce lines or groups of lines in figures?

    Thank you

    Casey

    Select the rows (or columns):

    Then, place the cursor on one of the row headings (the numbers on the left):

    so that you see the carat facing downwards, then click here to bring up the context menu for the lines:

    then select "hide selected rows.

  • Hidden lines in numbers using a checkbox

    How to hide the lines of numbers with a checkbox?

    Thanks in advance.

    Casey

    the boxes, then use the filter numbers:

    then go to the filter menu, place the cursor on the column with the checkboxes, then click on him pointing to the low carat, click on, then select the menu item "Filter Table > TRUE" or "Filter Table > FALSE.

    so lines disappear when they do not meet this criterion.  To turn off the filters, select the table, and then open the "Sort and filter" tool (top right of the window):

    ands deselect the "Filters" checkbox to the right of the book "filters".

Maybe you are looking for