Alter a column with sequence numbers

Hi to all,
i have a table (sample) with cplumns: sno, sname,dob and so on..........
In this table i have milions of rows with random numbers in column sno
i want to give the give the sequence numbers from 1 to 10000 in the sno column to the begining rows in the table
(Oracle)
could u post the code plese
thanks & Regards
Tangella

Tangella wrote:
Hi to all,
i have a table (sample) with cplumns: sno, sname,dob and so on..........
In this table i have milions of rows with random numbers in column sno
i want to give the give the sequence numbers from 1 to 10000 in the sno column to the begining rows in the table
(Oracle)
could u post the code plese
thanks & Regards
TangellaHow do you define "the beginning rows in the table"? Rows in a relational, heap table have no "order" to them. There is no concept of "first".
And once that is defined, why would you want to assign sequence number to only 10k our of "millions" of rows?

Similar Messages

  • How to create a column with increasing numbers in h:dataTable?

    I need to make a table that would have a column with order numbers, starting from 1 and increasing by 1 for every row. I tried using JSTL for this but it seems it is being ignored (as it probably should). My code is below. I know I am supposed to use getRowIndex() with bound tables, by my table isn't bound to anything...
    I could hold the number in the backing bean but that seems like a total overkill.
    Is there a proper way to this in JSF? Could I maybe somehow reference this (meaning tha table itself) within the EL expression?
    <c:set var="month" value="0" />
    <h:dataTable value="#{loansManager.rates}" var="rate">
                <c:set var="month" value="${month+1}" />
         <h:column>
              <f:facet name="header">
                   <h:outputText value="Month" />
              </f:facet>
              <c:out value="${month}" />
         </h:column>
         <h:column>
              <f:facet name="header">
                   <h:outputText value="Rate" />
              </f:facet>
              <h:outputText value="#{rate}" />
         </h:column>
    </h:dataTable>

    Bind the datatable to the backing bean and use HtmlDataTable#getRowIndex().
    You can find here an example: [http://balusc.blogspot.com/2006/06/using-datatables.html#AddRowNumbers].

  • Multiple volumes with sequence numbers

    Hello
    i see a strange behaviour for some volumes. For instance - i have an external hard drive connected via Firewire 800, where my Time Machine is located.
    If i look into the volumes folder i do see several folders with a red button on it named Time Machine, Time Machine 1, Time Machine 2, Time Machine 3. Only Time Machine 4 is displayed as an alias and contains the actual files. All others are empty. The same observation applies to my idisk. It seems that every day my Mac creates a new folder or a new alias. I have now 81 folders!
    The behaviour observed does not seem to hurt and the folders can be deleted, but in some applications (for instance Arperture) all these drive are shown as import folders, which is nasty if you have 81 idisks presented.
    It seems to me that it all relates to external hard drives. All local volumes have never shown these crazy sequence numbers
    The question is now why the systems behaves like this and how it can be avoided.
    Help is mostly appreciated. Thanks

    Thanks, Andreas for the explanation, which are helpful to get rid of those unwanted items.
    However the external firewire drive is always connected to the Mac pro - it is not a mobile device - it's purely for having the Time Machine on an external storage.
    And how should i avoid the behaviour with the idisk. The storage is a remote external device, where the connection is built through the Internet.
    Any additional ideas ?
    Thanks
    Michael

  • Filling column with Row Numbers

    How to fill a column with row number in power query like below? is there any function in power query?
    Color       Row Number
    Red         1
    Green      2
    Blue         3

    Hi...
    You can use "Add Index Column" function in Add column tab as below :
    Table.AddIndexColumn(Source, "Row Number", 1, 1)
    Regards,

  • Column with consecutive numbers in Numbers '09

    Very simple question -- I did a search for this, but because my query involves the word "Numbers," it returned everything!
    Okay, I have a list of 500 rows. I want to add a very simple column in Column A, that simply has "1" in Row 1, "2" in Row 2, all the way down to "500" in Row 500. If I type "1" into the first column, I can't seem to drag the cell down and do that -- it just inserts "1" into the entire column, which isn't what I want.
    In other words, I want Column A to very simply look like this:
    1
    2
    3
    4
    5
    6
    7
    8
    etc.
    What's the right way to do that? Thanks.

    It probably is in the Numbers '09 User Guide, but if you don't know the answer, and haven't developed some good search techniques, it's one you might have trouble finding in the Guide.
    John's subject line suggests he'd search using "consecutive" (zero occurrences), "number" (vast number of occurrences) or both words together (zero occurrences due to the absence of "consecutive").
    "pattern" works, but I found that out by scanning Chapter 4, finding the paragraph that dealt with this, then using what appeared to be a potent word for a search. "You can also add values to cells based on value patterns" is the first line of a paragraph on page 76 (not 78, which deals with conditional formatting) of the English language edition of the guide.
    I for one appreciate that John did a search, whether of the Guide or of this forum, before posting his question. That his search was unsuccessful is not really surprising; the information is moderately well hidden.
    Regards,
    Barry

  • APEX Report - how can i create column with serial numbers in a report

    Need help
    I have created a report with displaying no of rows resticted to 43, every time i genarate this report i would like to add serial numbers from 6 to 48
    apear in additional column. How can i do this?

    This is not really an APEX question, and would have been better posted on the {forum:id=75} forum.
    Note also that the best way to get fast, effective answer to questions is to provide sufficient information for people to fully understand them:
    http://tkyte.blogspot.com/2005/06/how-to-ask-questions.html
    You should also ensure that your forum profile is updated with a better handle than "user8308442".
    Getting back to the question, one way to do this is using the analytic function ROW_NUMBER():
    with t as (
    -- Test data. Replace with actual query. ---------------------------------------
      select
                dbms_random.string('a', 10) query_data
      from
                dual
      connect
                by rownum <= 43)
    select
              5 + row_number() over (order by query_data) sn -- use required ordering here
            , t.query_data
    from
              t
    order by
              sn
    SN                     QUERY_DATA
    6                      CApoRenlch
    7                      CDiUiSYdMo
    8                      FsjsWFpTMT
    9                      KbbzXvYmQv
    10                     MrjEPqAzFs
    11                     QKOPSdVWpr
    12                     REIXjjdLtD
    13                     RijqpNTzmv
    14                     RngzthgaFv
    15                     SKcPxsdlBE
    16                     SuqFKzMqbB
    17                     TxlglIYENC
    18                     TyWlxKbDIg
    19                     VdRbUOUOPz
    20                     XIQxzkBuKY
    21                     YVcWUJrswt
    22                     aVoYNlMkfx
    23                     cHZPsOlzYM
    24                     cTUEztIOae
    25                     etdNGqQasP
    26                     fVGoGWmdLL
    27                     gHANXpbvMW
    28                     gRNBnwtEhO
    29                     iyefgszgLT
    30                     jRaliUJjKS
    31                     jpzAvQXBwY
    32                     kJifAaetUN
    33                     kfbTWGGCpR
    34                     mTPtqYGvrG
    35                     mhAPgdzezZ
    36                     pdXidmikRX
    37                     pwNdAsqpIV
    38                     rPTBTObdKg
    39                     sFoNLHLeMH
    40                     squTbOYVUM
    41                     tPxSMqPpnQ
    42                     uJtqCybjXB
    43                     vEvrwnGnyJ
    44                     xOOseicRRy
    45                     xqqXBKURog
    46                     ydOPurqyvo
    47                     yqEZvoNsbg
    48                     zsWFLHjVLK
    43 rows selected

  • 9.2 issue with  Sequence Numbers

    We are using OWB 9.2 and RDBMS 9.2 on windows NT.
    When using set based functionality i.e. Merge Statement, or Row Based, we have noticed that our sequence object gets incremented during updates even though it is only associated with the insert and not the update.
    Is this normal behaviour or an issue ???

    Jagadish,
    You will not get updates because you by default match on the keys on the table. In other words you emp_id and the seq.nextval are matched to what you have in the table and they will never match (because of the nextval).
    Two things you can do:
    - Change the composite key (e.g. change the design)
    - Change the configuration in OWB
    Let's look at the second one, what you must do is the following:
    1) On the target table, select operator properties and find "Match by Constraint". Highlight that and change this setting to No Constraints.
    You now are not using the constraint, so you must tell OWB what to match on. You do this by:
    2) Highlight the EMPID column and select attribute properties
    3) In the loading properties node set the following for EMPID:
    Load column when inserting row => Yes
    Load column when updating row => No
    Match column when updating row => Yes
    4) Highlight the other columns, for example ATTEMPT_COUNT and select attribute properties
    5) In the loading properties node set the following for ATTEMTP_COUNT:
    Load column when inserting row => Yes
    Load column when updating row => Yes
    Match column when updating row => No
    This should allow you to update based on the EMPID alone.
    Hope this helps,
    Jean-Pierre

  • After Yosemite download excel files save separately with sequenced numbers

    Yosemite excel save problem

    hi... This forum is for troubleshooting Apple Software Update for Windows, a software package for Windows designed to update Apple products that run on Windows, and not related to Microsoft Office or your question in any way. If you have issues or questions about Office, it's probably best you post Office related questions on Microsoft's own forums for their Mac products.
    http://www.officeformac.com/productforums

  • LR3 Web Gallery Sequence Numbering bug?

    Anyone else getting this problem with sequence numbering in the web HTML templates? Basically, as you jump through photos the photo number is always stuck on #1, never changes when you go to the next photo - should go 1, 2, 3, 4, 5...
    I just sent a bug report but, wondering if anyone else found a fix for this yet.
    This is in LR3 on Mac - really trying to do this on TTG Highslide gallery but, same problem occurs in default Lightroom HTML gallery.
    Thanks.
    ******BUG******
    Concise problem statement:
    Steps to reproduce bug:
    1. Go to Web Module
    2. Choose default HTML Gallery
    3. Under Image Info set Caption to Sequence
    Results:
    Sequence caption always shows 1/total images.
    i.e. 1/10,  1/10,  1/10,  1/10
    Expected results:
    Sequence should increment current image number / total images as you click through images.
    i.e. 1/10, 2/10, 3/10, 4/10

    Yeah, still have the numbering problem using the Image Info sequence outputs.
    But, if you use the standard Lightroom Flash Gallery it has it's own sequence numbering output (that does not use Image Info captions)  and it does work correctly. These show up as 1/9, 2/9, 3/9 etc. on each photo down by the back/next buttons.
    Also, the Cell Numbering does work when using the Lightroom HTML Gallery - though, those numbers only appear on the index page not on individual photos.
    But, haven't seen a good work-around yet for sequence numbering in Image Info area. Only option there seems to be typing numbers manually into the caption. Or, if you need the caption for other info maybe use one of the IPTC fields like Headline to type in your numbers. You can then do a Custom Setting in web module to have those text fields show up with your photos.
    Really hoping we will see a LR 3.1 sometime soon with a fix - should be an easy correction for Adobe.

  • Pre populate field with integer numbers?

    Hi,
    I want to pre-populate my field which is integer type with numbers in a sequantial order like 101,102,103,104...
    How can i do this with 10gr2?
    Regards.

    Actually i have two tables.
    First table has ID1, NAME1, REF1 columns.
    Second table has ID2, NAME2, REF2 columns.
    ID1 and ID2 is autonumbered id columns. NAME and REF columns are emtpy columns. I populated NAME1 and NAME2 manually entering data from my project.
    Now i want to relate each table's rows one by one, i.e., one to one cardinality. Therefore, i have to populate first table's REF1 column with sequantial numbers, and then manually enter corresponding number to table two's REF2 columns.
    I don't want to use ID columns, because i insert data these tables at different time intervals.
    Hence, when i query TABLE1's NAME1 data, i will see corresponding data in TABLE2's NAME2 column via this relationship.

  • How do you create a column of sequenced dates in Numbers

    How do you create a column of sequenced dates in Numbers without typing in each date? For example: 01/05/15, 01/12/15, 01/19/15, 01/26/15, 02/02/15, etc.

    Hi Cha Ling,
    Another way,
    Enter your first two dates that show the desired interval- i.e. 01/05/15 and 01/12/15.
    Select both cells and choose fill from the contextual menu.
    Drag down to fill your column.
    quinn

  • I am having trouble getting a numbers spreadsheet to hold different formats in the same column.  A column with a date formatted heading will not convert to $ for the cells below.   Any suggestions would help.

    I am having trouble getting a numbers spreadsheet to hold different formats in the same column.  A column with a date formatted heading will not convert to $ for the cells below.   Any suggestions would help.

    Hi Wayne,
    Thank you for this response.  I have tried this but when I start enterring $ amounts some, such as $6.00, go in OK others such as $4.00 appear as a date ie 4 Oct 12.  
    Kind regards
    Paul

  • Sequence numbers - with no gaps!

    I seek some advice from anyone with first hand experience in this area.
    My need is simple; generate a new ID number for every order for use as the primary key.
    Obviously this simple exercise could be a bottleneck as volumes ramp up, so I was pleased to find the Oracle feature to generate such numbers (efficiently presumably). However, upon closer reading it was apparent that aborted transactions would result in the loss of the number allocated to to that order if another transaction had obtained the next sequence number already (as one would want it to, rather than serializing transactions).
    I don't want to have gaps in the sequence as the system needs a high degree of auditability. I am thinking of utilising the Autonomous Transaction feature to write the newly acquired sequence number to the order file with a flag indicating that the record is incomplete, and that record is to be skipped by normal system applications (but available to audit reports which will interpret the reason correctly), then returning to the far more extensive main transaction which updates many tables.
    The other alternative is to control sequence numbers within the application itself, or try to get the sequence number as the very last step before writing the new order record, but this probably won't guarantee gapless reliability either. The ID itself has no significance, and it doesn't matter if an ID was used out of strict date/time sequence, so I really don't want to execute these updates serially.
    So, my question is this:
    a) do most people use the builtin sequence number feature?
    b) if so, is there a standard technique for avoiding or accounting for gaps?
    c) if the application must take over this task, should the counter for the last used ID be in a single row table to minimise bottlenecks caused by the thisrecord being locked? There will be several such counters for different aspects of the application, and i thought of having each in its own row in a small table, but I'm concerned about the whole table getting locked and freezing out otherwise-unrelated updates.
    Thanks for any advice you may have.
    CS

    user8821725 wrote:
    I seek some advice from anyone with first hand experience in this area.
    My need is simple; generate a new ID number for every order for use as the primary key.
    Obviously this simple exercise could be a bottleneck as volumes ramp up, so I was pleased to find the Oracle feature to generate such numbers (efficiently presumably). However, upon closer reading it was apparent that aborted transactions would result in the loss of the number allocated to to that order if another transaction had obtained the next sequence number already (as one would want it to, rather than serializing transactions).
    I don't want to have gaps in the sequence as the system needs a high degree of auditability. One of the very very few reasons for me to have a requirement for "gapless" sequences is if you have a kind of checking mechanism outside of the database that is implemented using this gapless number. I had such a requirement once, when exchanging files with another bank where we had to ensure that each file was transferred correctly and in the right order. Your "high degree of auditability" might be a similiar requirement. Just remember as long as you are still inside the database you can use other mechanisms to increase auditability.
    I am thinking of utilising the Autonomous Transaction feature to write the newly acquired sequence number to the order file with a flag indicating that the record is incomplete, and that record is to be skipped by normal system applications (but available to audit reports which will interpret the reason correctly), then returning to the far more extensive main transaction which updates many tables.Hm. I don't see why you want to use Autonomous Transactions for this. It might be useful to lessen locking conflicts , depending how your future sequence mechanism will be built.
    >
    The other alternative is to control sequence numbers within the application itself, or try to get the sequence number as the very last step before writing the new order record, but this probably won't guarantee gapless reliability either. The ID itself has no significance, and it doesn't matter if an ID was used out of strict date/time sequence, so I really don't want to execute these updates serially.I would go for generating the sequence as the very last step. It needs to be set to NOCACHE of cause. This will garantee that the sequence fetched from mySeq.nextval is gapless. The problem is then in your application. Your application must be built in a way that it ensures to use this sequence, or at least to create a noticable alert when this generated sequence can't be used anymore. In essence this means. Each unhandled (database) error that happens after you fetched the next sequence value must be raised in a way that informs all relevant people about this error.
    Example: It might be that you use the sequence to write an order file. What happens if halfway through writing the file your disk runs out of space? This can be such an issue where a sequenced value will be lost. Your organisation must take care of those things.
    >
    So, my question is this:
    a) do most people use the builtin sequence number feature?Yes. But for some tasks a sequence is not the best way, for example if you want a numbering for each item of your order. This "sequence" needs to restart with every new order.
    b) if so, is there a standard technique for avoiding or accounting for gaps?NOCACHE => Avoids gaps during generation
    Database Trigger => Tries to use the sequence as late as possible
    c) if the application must take over this task, should the counter for the last used ID be in a single row table to minimise bottlenecks caused by the thisrecord being locked? There will be several such counters for different aspects of the application, and i thought of having each in its own row in a small table, but I'm concerned about the whole table getting locked and freezing out otherwise-unrelated updates.This is a possibility and the issues you describe are why we avoid such a solution in general. Autonomous transactions help to reduce the locking conflict, but they increase the chance that you produce gaps.
    >
    Thanks for any advice you may have.
    CSOracle can guarantee to produce gapless sequences. But it can't guarantee that your application uses such a sequence in a gapless way.

  • Trouble with SEQUENCE, loosing numbers

    Hi all, I use a sequence to generate the number of an invoice like this:
    Insert into table
    values(owner.sequence_name.nextval);
    But, if an error occurs this number get lost because of the way the sequence works, how can I avoid this??, there is another way to do it??? It doesnt matter if that solution doesn't use the sequence, but my design cannot accept numbers like 1,3,4,5,7, it has to be 1,2,3,4,5,6,7....
    Leo
    null

    Unfortunately, this is another one of those concepts that sounds simple but isn't.
    Yours is not an Oracle (or any other DB) problem; it is a design problem.
    The reason that none of the suggested alternatives solve your problem is that there are undefined elements in your requirements.
    There are actually two aspects to your of problem: 1) generating unique sequential numbers and 2) using those numbers.
    I would suggest starting over and try to clearly define the problem and the requirements.
    For example your stated requirements appear to be something like:
    1. Invoice numbers must to be unique
    2. Invoice numbers must be numeric
    3. The first invoice number must be 27 (modify per your requirements)
    4. Each new invoice must be numbered one higher than the previous invoice.
    5. Invoice numbers must be sequential with no missing numbers.
    While the above list seems to be complete there are some very important questions that are not yet answered.
    1. When does an invoice become an invoice? That is, when is the invoice number assigned? Is the number assigned before or after the invoice record is committed to the database? If the number is assigned before committing (e.g. when the user begins processing an invoice) but the invoice is then abandoned and never committed there will be a gap in invoice numbers.
    2. Can invoice records ever be deleted? If a committed record is deleted there will be a gap in the numbers. Some systems handle deletions by either flagging the records as deleted without actually deleting them or moving the records to a deleted table so that all invoice numbers are always accounted for.
    Check printing applications used to print on pre-numbered check forms. The line printers that were used had sprockets to feed the checks and the first check could not be printed on since the sprockets were above the print head. The operator would enter the first check number into the system and the application created a check record marked VOID for that check number. This ensured that all pre-printed checks were accounted for and had not been misplaced or stolen.
    Oracle's sequence generator can generate sequence numbers in sequential order and ensure that there are no gaps in the generation process.
    Oracle cannot ensure that your application uses those numbers in a way that avoids gaps.
    Even a normal INSERT trigger that might be used to get the next sequence value cannot be certain that the record it is inserting will actually be committed unless the COMMIT operation is performed within the trigger.
    Sorry to 'rain on your parade' but withouth a better problem definition we can't give you a better solution.

  • Merging two columns with muliple rows in Numbers '09

    I am trying to merge two columns each with 100 rows and related data. Column one is the street address and column two have office numbers. The final result would be one column with 100 rows with address and office numbers.
    Ed Carreon

    sanpanza wrote:
    I am trying to merge two columns each with 100 rows and related data. Column one is the street address and column two have office numbers. The final result would be one column with 100 rows with address and office numbers.
    Ed Carreon
    Hi Ed,
    Use the CONCATENATE() function.
    Street address in column D, Office number in Column E
    100 Smith ST            212
    Formula: =CONCATENATE(E," ",D)
    Result:
    212 100 Smith ST
    Note the formula has three arguments, the reference to column E, a text literal (" ") containing a single space, and a reference to column D.
    Regards,
    Barry

Maybe you are looking for

  • Help for a MOBILE application...

    Hello friends, I am working on a mobile application that would be similar to dictionary. We need to store words in form of database. User would have to type a word to get all related stuff stored in database. I am unable to figure out what technologi

  • Built in Mic has never worked

     Product Name and Number:  HP Pavilion dv7 Notebook PC Serial Number {Removed for privacy} Product Number LM726V Operating System installed Windows 7 Built in Mic has never worked Has not work ever

  • Sync without album artwork

    There is not enough space to sync my Ipod.  I had downloaded the album artwork and I believe that is what is taking up the space.  Can't figure out how to sync without the artwork or how to remove the artwork so my music will sync.  Any suggestions?

  • Safari 2 running on 10.4.11 SOLVED

    If anyone cares i got safari 2 running on 10.4.11. Heres a how to video http://www.youtube.com/watch?v=tTZuOjyyIdA James

  • Photo no showing up

    would like to asking why some of the photo that capture no showing up at my iphone 6 , but have showing up at laptop. how to settle this case , please help . waiting your feedback asap . thanks