How to execute a same sequence number for the resulting dynamic rows

Hi friends,
I have a sequence and trigger(which will fire id for each and every row insert).
My scenario is, If i update more than 5 rows at a time means, i need to set a same sequence number example(1) for all the 5 rows.
Next time, if i update another 5 rows means, then i need to set a same sequence number (i.e) 2 for the next 5 rows.
So, my updation will be dynamic(may be 2 ,5, 10 rows at a time), But i need to set a same sequence number for one of the column for all the rows that i update.
Next time, if i update another set of rows means, then i need to set only the next sequence number(i.e) 2(assume that previously updated sequence for the before set of rows is 1) for another set of rows.
Like that sequence has to update in a sequential manner for more than one set of rows in that column.
How to achieve it friends.
example
id-----------------name
1-------------------A
1-------------------B
1-------------------C
1-------------------D
1-------------------E
2-------------------D
2-------------------E
2-------------------F
2-------------------G
3-------------------H
3-------------------IBrgds,
Mini

Hi,
You forgot to mention your version.
If you want a trigger based solution, then in 10g you need two triggers
1. A statement level trigger that takes sequence.nextval into a dummy variable that will not be used.
2. A for each row trigger that uses sequence.currval.
In 11g you should be able to write a single, composite trigger.
If you want a solution with no triggers, it could look something like
SQL> create sequence s start with 10;
Sequence created.
SQL>
SQL> create or replace function s_wrapped
  2  return number
  3  as
  4     v number;
  5  begin
  6     select s.nextval
  7     into v
  8     from dual;
  9
10     return v;
11  end s_wrapped;
12  /
Function created.
SQL> create table tab1 as (Select level x, cast(null as number) y from dual connect by level <= 5);
Table created.
SQL> update tab1
  2    set y = (select s_wrapped from dual)
  3   where x <= 3;
3 rows updated.
SQL> commit
  2  /
Commit complete.
SQL> select *from tab1
  2  /
       X          Y
       1         10
       2         10
       3         10
       4
       5
SQL>Regards
Peter

Similar Messages

  • I downloaded a Trial version of Adobe Acrobat XI.  Now the trial has runout and I've signed up for a subscription.  However, my software still needs a serial number.  How can I get a serial number for the installed software?

    I downloaded a Trial version of Adobe Acrobat XI.  Now the trial has runout and I've signed up for a subscription.  However, my software still needs a serial number.  How can I get a serial number for the installed software?

    There is no serial number and you don't need one. What you need for a subscription is to SIGN IN within Acrobat, so it knows the subscriptions you own.

  • How to execute a string formula and assign the result to a number field

    How to execute a string formula and assign the result to a number field
    Hi,
    we have a function that returns a string like this:
    '(45+22)*78/23'
    After we should calculate this string and assign the value to a numeric block field
    Example:
    k number(16,3);
    k:=fun1('(45+22)*78/23'); where fun1 execute and translate to number the string.
    Does exist a function like fun1 ??
    How can we do ?
    Regards

    Hello,
    this is the code that does the job:
    SQL> set serveroutput on
    SQL> DECLARE
    2 ch VARCHAR2(20) :='22+10' ;
    3 i NUMBER ;
    4 BEGIN
    5 EXECUTE IMMEDIATE 'select ' || ch || ' from dual' INTO i;
    6 dbms_output.put_line ('i = ' || TO_CHAR(i));
    7 END ;
    8 /
    i = 32
    Procédure PL/SQL terminée avec succès.
    SQL>
    just you have to do is to create a small stored function that take the string to calculate and return the number result
    Francois

  • How can find SCN or sequence number on the update operation?

    nedd to recovery database, how can find the SCN or sequence number before the update exection?
    thanks

    nedd to recovery database, how can find the SCN or
    sequence number before the update exection?Sorry - there is something confusing about your question ...
    It seems to me the SCN is the 'system change number', which identifies when a change (table, row, block, flush log buffer to log file, etc) has ocurred.
    You seem to be asking for the SCN associated with an update before the update actually occurred.
    Are you actually asking "How do I perform a point in time recovery to immediately before a specific update?"
    Perhaps you could include a few more details, such as database version. For some reason different versions have different capabilities - that could be helpful here.

  • How do I find my serial number for the product I downloaded?

    How do I find my serial number if the product was downloaded.  I had to re set the operating system and now Adobe is asking for the serial number.

    Hi shellsy,
    Which service you are using?
    Kindly refer to this FAQ:Find your serial number quickly
    Regards,
    Florence

  • How can I locate my serial number for the Student and Teacher Edition

    All I am trying to do right now is to obtain the serial number for my Student and Teacher (Academic) Edition <removed by moderator>, but I wanted to use my personal (home) e-mail address since this purchase is to be installed on my home computer.  The validation process seems to require my work e-mail address or a work id with embossed date (ours had no date and my id is at work).  The e-mail prompt indicates that all e-mail correspondence will go to the address I enter so if there is e-mail regarding this installation, on my home computer at my home e-mail address, any such e-mail instructions would then go to my work e-mail address.  So how do I obtain my serial number?

    I have removed your coupon/product code as this is a public forum.  I would recommend reviewing the I have a Student and Teacher edition product section of Find a serial number.

  • How to convert exponential data into number for the downloaded excelsheet

    Hi
    I have downloaded one field data i.e. having char of 50,  into excel sheet and it is displaying as  exponential in the excel sheet. 
    The data numbers should display as text only i.e 1236547896321 and not exponential
    Is anyone can tell how we can do this
    Thanks
    Pallavi

    Hello Pallvai,
    The problem of exponential is with the excel. Excel converts the large numbet into exponential.
    To avoid this you can make the number into text then excel won't convert it into exponential.
    For that you can do a simple trick. Just prefix a single quote ( ' ) in the field.
    eg:
    field = 1236547896321.
    then,
    constants c_quote type c value '''.   "<-- single quote
    concatenate c_quote field into field.
    " This will make the EXCEL to consider this field as text not number and hence it will not be considered
    " as exponential.
    Hope this solves your problem.
    Regards,
    Sachinkumar Mehta

  • How can I change my phone number for  the security message

    i cant send to my new phone numbte the security message, what can i do

    Welcome to the Apple Community Paulette.
    If you are referring to the keychain phone number...
    Go to System Preferences > iCloud > Account Details, you can change your verification number in the options provided there.
    Go to Settings > iCloud > Account > Keychain, you can change your verification number in the options provided there.

  • How do I find my serial number for the education version?

    i lost my serial number and i dont know how to retreave it??

    Adjowah1 please also see http://forums.adobe.com/message/4635085#4635085 where this topic has been discussed.

  • How to generat sequence number for db in XSLT

    Hello SOA Gurus,
    I have a requirement, Please see below
    I am using SOA 11.1.1.6
    From a webservice call to db insert XSLT,  i have 10 elements at source side and 11 elements at target side.
    From source to target first 10 mappings are done.
    Now requirement is, for the 11th element in target- we need pass a sequence number to the targeted database, means---(sequence number has to be generated for every execution of XSLT execution)
    How to do the last point???
    Can anyone help me plzz

    Hi,
    You can pass the sequence number in the 11th element using "oraext:sequence-next-val("Sequence name as a string", "Datasource as a string") function.
    Regards,
    Anshul

  • How do I use multiple local workspaces for the same website in VS2013?

    For quite some time I've been using VS2010 with multiple workspaces mapped from the same TFS branch to test different variants of a website in parallel. The internal web server (Cassini) seems quite happy to run multiple versions and simply maps a new port
    number for the second and subsequent instances that start up.
    We are now looking to move to VS2013, so have to use IISExpress since the 'internal' web server is no longer provided.
    How do I configure things so that if I open a single workspace, IISExpress runs against that workspace using the default port number (specified in the solution), but if I open a second instance in a different workspace it correctly uses a new port number
    and working folder. Do I need to invoke IISExpress using the command line (presumably from each workspace) and specify the relevant defaults or is there some way to enter this in the local config file for IISExpress?
    My initial attempt at editing to config file resulted in the 2nd and subsequent instance using the same physicalfolder as the first instance, presumably because the speficied site name and port number are the same!

    Hello,
    Thank you for your post.
    I am afraid that the issue is out of support range of VS General Question forum which mainly discusses
    the usage of Visual Studio IDE such as WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System
    and Visual Studio Editor.
    Based on your description, I suggest that you can consult your issue on ASP.NET forum:
    http://forums.asp.net/
     or IIS forums: http://forums.iis.net/ for better solution and support.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • I recently subscribed to Acrobat XI after the trial expired but when I went to activate it I was asked for the serial number. I only have the order number on the invoice. How do I get the serial number for the trial software that is on my computer?

    I recently subscribed to Acrobat XI after the trial expired but when I went to activate it I was asked for the serial number. I only have the order number on the invoice. How do I get the serial number for the trial software that is on my computer?

    Please do not try to send attachments in mail responses to forum messages. Please return to the forum and click Reply. You can then use the CAMERA icon to add your pictures. Looking forward to seeing what is wrong with your license screens - the general advice is simply to sign in, and everything is done. Make sure you use the SAME Adobe ID that you used to purchase, and check your account details to be sure the subscription is active.

  • How to track the transport request number for the Role/Composit Role

    Hi,
    How to track the transport request number for the Role/Composit Role.
    Thanks,
    Ravi

    Use transaction SE03 Transport Organizer Tools
    Execute "Search for Objects in Requests/Tasks" with objects of types:
    R3TR     ACGR     Role
    R3TR     ACGT     Role - User assignment
    Regards

  • Sequence Number for messages

    Hi,
    I need to implement a sequence number in the target structure for each time a message mapping is executed.
    As far as i can see on this forum and on sap.help.com it can be easily done with RFClookup inside the message mapping, and best implement something on abap-stack.
    I need to decide on using either a z-table or a number range and i need to decide whether to use PI abap stack or ECC abap stack.
    Any comments are useful.
    kr
    Robert

    Hi Bhavesh,
    I get interesting considerations on my question.
    It will be sequentially, almost for sure,  because i get this message via flatfile.
    Your second consideration is also interesting. Maybe the source can provide, maybe not (i'm not sure)
    Even more interesting if it is really necessary at the receiver side. This i actually asked the business, but still waiting for an answer. Meanwhile i just started looking around for the correct solution.
    kr
    Robert
    On second thought. It will be unique if i use number ranges with RFC lookup, because each number can only be used once.
    Edited by: R. den Hoedt on Mar 16, 2011 4:37 PM

  • How to find Ship to party number for a Sale doc.

    Hi,
    Currently, I have a sale doc number with type ZDR (Debit memo request). Could you please let me know how can I get the ship to party number for that document number.
    In General, Could you please show me how to get ship-to party number for a sale doc with all sale doc type ?
    Thanks,

    Hi Krishna,
    Your answer is correct, I just go to table VBPA pass the sale doc number & choose the partner function as ship to party, then I can get the ship-to-party ID.
    Hi Sandipsinh,
    The KUWEV is the customer master data view that is used in standard T-code. However It is not a table, therefore I can't get data from it.
    Hi  senya_1111,
    You know, with a sale order we have only one sold-to-party. However, we can have several corresponding ship-to-partys.
    Moreover, In table VBAK(Sale order header)  we just have sold-to-party not ship-to-party. That means we can get wrong value in case ship-to-party is not the same as sold-to-party.
    Overall, Thank all of you for your opinion.

Maybe you are looking for

  • My iPhoto Library is too big for my iMac

    My iPhoto Library is now 272gb so is taking all the space on my iMac, so I need to move it off the Mac. I believe I can copy it to an external drive and then just "point" iPhoto at it by holding down the Alt key on launch? But I am very nervous about

  • Working day formula that excludes weekends and holidays in WEBI

    Hi Guys, Can we calculate a working day formula that excludes weekends and holidays in WEBI OR in Universe? The universe I am working on is using stored procedures, so there are no joins or modelling done. Although there is a workday stored proc  tha

  • Cannot trash shared HD

    File sharing with leopard on the mac in question with another mac that is using tiger (if that matters). It seems that I cannot trash the HD or home folder that is being shared on the leopard mac without stopping file sharing. In tiger I could trash

  • RFC enabled function module to insert , update and delete data in a ZTABLE

    friends.. Is there any standatd RFC enabled function module to insert , update and delete data in a custom database-table (Ztable)? if not how can we create it? plz give me the details steps.. what are the import, export parameters and how to code an

  • Error updating nokia 6300 software

    Heloo I tried o update my nokia 6300 device, I downloaded the program from the net! It was ok, untill i tryed to update my phone! Apperars a screen, which says:Updating software, pls w8: and then don't panic.Everything happes ok,my screen blanked. Bu