How to generate an incrementing batch-number per set number of rows

Hi,
How could you generate an incrementing batch-number per set number of rows for a table in SQL?
The returned result set of the SQL query should show a preceding batch number per row set and incremented by 1 for the next row set.
Eg, you want to start the batch_number by 1 for the first three returned rows of the table and than increment by 1 for the next three rows.
The result set would look like:
BATCH_NO, TAB_COL1, TAB_COL2, TAB_COL3, TAB_COL4, ..
1, ...
1, ...
1, ...
2, ...
2, ...
2, ...
3, ...
3, ...
3, ...
etc.
Cheers.

Many thanks guys, I would have never thought about these options.. Yes the reason for adding the preceding batch number has to do with migrating data from a source table where we only can grab small sets of rows at the time to bring across to a target table.
Cheers.

Similar Messages

  • How to generate dynamic report base on a set of parameters?

    I want to know if it's doable-
    My page needs to display a set of reports, generated from sql queries with a set of binding
    variables (or user input), the columns of each report are also generated from
    sql queries.
    If doable, would you please point me to some references?
    Thanks for any info.

    Hello,
    You can base your report on a PL/SQL function return a SQL query, for ex.:
    begin
        return 'select ename, job, sal from  emp';
    end;Regards,
    Dimitri
    http://dgielis.blogspot.com/
    http://www.apex-evangelists.com/
    http://www.apexblogs.info/
    REWARDS: Please remember to mark helpful or correct posts on the forum

  • How to generat multiple invoices based on per employee/contractor/services?

    Hello Experts / Dina,
    I am in situation where customer is in business of body shopping and charges to his final customer based on individual invoice / per employee /contracor & customer services. This was happening in legacy system but after the implementation of Oracle Project costing and Oracle Project billing, customer is not able to generate invoices per employee services. Rather consolidated invoices are getting generated.
    How to achieve this functionality in oracle project billing?
    Lets take example - On Project P1 for customer ABC, 3 below employees are working on different task for 3 months.
    Now after one month employees have been billed as shown below.
    Emp 1 - 1000 USD - for 100 Hrs
    Emp 2 - 2000 USD - for 200 Hrs
    Emp 3 - 1000 USD - for 50 hrs
    Now @ end of the month when invoice is getting generated is 1 invoice including 3 lines of amount total 4000 USD. There is problem; customer wants that there should be 3 different invoices per employee shoud generated based on above mentiond 3 diff lines for customer ABC.
    I guess with oracle projects billing - You can split the invoice based on Accrue through date ( which is not possible in this case ) and agreement ( which is also not possible in this case ) and different currency ( which is again not possible in this case) - I may be wrong when saying it is not possible. plz correct me if I am wrong.
    even I guess billing extension wont work. So is there any way to achive this?
    Right now only option i am thinking is let single invoice of 4000 USD with 3 different lines should pass to AR and while priniting the invoice customer can create 3 diff prints which includes individual lines. and while applying receipts on the single invoice in the system, customer can apply the receipts to indivual lines.
    but I am not sure about AUDIT issues.. Can some one think about any AUDIT issues comes to this approch or issues with TAX rounding amount issues ?
    Infact I would like to solve this issue with the help of Oracle Projects billing and not with custom invoice print program. I guess someone from you experts can figure it out to generate muiltple invoice based on employees / suppliers / contractors / materials etc.
    A suggestion on Extension / customization / seeded functionality of Oracle Project billing on thi issue would be gr8 help.
    Please help.
    Thanks
    Edited by: oracle_samba on Jan 7, 2013 1:06 AM
    Edited by: oracle_samba on Jan 7, 2013 1:07 AM

    Hi Dina,
    First of all thanks for your update :-) Your solution looks much promising.
    I thought of using billing extension but rejected on the ground that I would end up in generating events based on employee for their corsponding billig amounts so finally generating a consolidated invoice only in One GDI run. But what i was missing was pre-processing extension and running the extention in loop based on employee count.
    I am fully sure business would not have any issues of auto approving and releasing invoice upon generation. But my question is "is it possible to just approve the invoice & not release it using auto approve and release extension?" The reason is I think when GDI runs it only deletes Unapproved invoice & spare Approve invoices. - So please suggest.
    Also please validate my understanding about your solution with an existing example -
    As with the current example, there are 3 EMP presents so need to run GDI 3 times and develop pre-processing ext in a such a way that at each time it will put on hold on all the billable items except EMP1, and EMP2 and EMP3 on each consecutive run respectivly. And ensure that Auto Approve and release extension should be used in order to avoid overriding previously generated invoice? Am I right ?
    Many Many thanks for solution !!!
    Regards,
    :-)

  • How to generate auto increment id for sharepoint list item using calculated column?.

    Dear all,
    List Id will be auto generated in the format “TP_W1_SCO_00001”.(00001 Numbers will keep changing for the documents).
    FOR EX:-
    first listem ID :TP_W1_SCO_00001
    sECOND listem ID :TP_W1_SCO_00002
    Please tell me how to do it by using calculated column.
    Regards
    swapna
    SWAPNA

    In this solution you have to make two additional columns and one workflow.
    step 1 :
    create column ‘pID’ on the list of the type number.
    Step 2:
    Create on the list with SharePoint Designer a listworkflow
    Set in the start option: ‘Start workflow automatically when an item is create’
    In the workflow you set de column 'pID' with the value from 'ID' ( standard column)
    Use for this the option: ‘Set field in current item’.
    You need that because you can't use the column 'ID' in the formula in an calculated column
    Step 3:
    create column ‘IssueID’ on the list of the type calculated column.
    Use the formula:
    =""&"TP_W1_SCO_"&[pID]
    /blog
    twttr @esjord

  • How to generate license for AIP-SSM without PAK-number?

    Hello! I’m sorry for my English. I have a problem with generating license for AIP-SSM. My contract with SMARTnet service is activated, but I don’t have a PAK-number. How I can generate a license for updating my module?

    Alternatively you can always write an email to [email protected] with your serial number and they should be able to provide you the license for any cisco device.
    Sachin

  • How to generate auto incremented ID using a user who has create,view permissions only

    Hi
    i am using  the builtin ID
    field  to achieve generate sequence no  in a list
    every time a new item created in list
    for this i used update list item action in workflow, its working fine but
    i have a problem here user who login into sharepoint site and create a new list item
    has only Create ,View Permissions only,
    i created a Requesters permissions level with (Create,view ) rights only i did not  added Edit Rights
    because this user only create list items only  he will not edit the list item.
    adil

    Hello adil,
    If user is having "Add Items" rights then item ID should be created automatically and this is auto generate column in list.
    Why you are using "update list item action"? Are you updating any other field?
    If updating any other column value then add Impersonation steps in your code to update item.
    http://sharepoint.stackexchange.com/questions/16232/impersonation-step-in-sharepoint-designer-2010
    http://sharepointgroup.wordpress.com/2012/05/10/how-to-use-work-flow-to-change-list-item-permissions-by-sharepoint-designer-2010/
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Help wanted! How can generate forms in batch mode from command line?

    Hi Guys!
    I saw few years ago one utility wich can do this. We have application in designer repository. We want to regenerate all forms but now we must use designer gui for that.
    Could anybody knew any utility tools for make this generation easier and quicker?
    It would be nice to have this tool. We want to bye if anybody sell it?

    See if the following Oracle Designer Help topics are relevant:
    'About batch generation and design capture'
    'About the batch processing wizards'
    'Performing batch processing'

  • Dunning Block per document number

    Hi SAP Guru,
    Need your help.
    Scenario is like this:
    We are running the dunning letter and it always gives us no output.  Also, checked the Customer Master,  under Correspondence tab and field for Dunning Block is empty while payment methods under u201CPayment Transactionsu201D tab is also empty which is I think it should be to run the dunning. 
    Upon further investigation,  I found out that the invoices are tag as u201CDunning Blocku201D via FBL5N per document number.  Can you explain how this happened? And why does per document number is tagged as u201CDunning Blocku201D despite the correct set up in Customer Master.  And how can we delete the tag per document or is there any mass update for this. 
    Appreciate your thoughts on this.
    Thanks,
    Julie

    Hi,
    Thanks for the info.  As I checked if dunning block has been tagged in SO via Header --> Accounting Tab,  the field for Dunning block set to Freed for Dunning which I supposed should be. 
    Any other solution on this.
    Thanks,
    Julie

  • How to automatically assign a batch number

    Hello experts,
    Our customer have the "Manage Item by" settings on "Batches" and the "Management Method" settings on "On Release Only".
    He don't want to manually generates the batch numbers in Delivery Entry because he would like to have an automatic assignment of batch number like a progressive number for year.
    How can I achieve it using DI API ?
    I have tried to create a Delivery Document using the BatchNumbers object but I got the following error message "the batch number you selected doesn't exists".
    So I created a Goods Receipt for the batch number above and finally the delivery document has been created successfully.
    The issue came out is about the stock quantity for the itemcode because the Goods Receipt have increased it and as result I have the same stock quantity as before the delivery and of course it's not correct !
    I noticed that SAP B1 after the manually generation of batch number it creates a record on the OIBT table using an existing Good Receipt.
    How can I add a batch number in the OIBT table using DI API  without the need to create a Good Receipt ?
    Can someone help me ?
    It would be very appreciated.
    Many thanks for your time in advance.
    Best regards
    Andrea

    Hi,
    Try this code, May be it will help you
    Dim v_StockEntry As SAPbobsCOM.Documents = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInventoryGenEntry)
                Dim v_StockExit As SAPbobsCOM.Documents = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInventoryGenExit)
                Dim str_ProEntryNo As String = oDBDSHeader.GetValue("DocNum", 0)
                'Dim str_DocDate As String = CDate(frmProductionEntry.Items.Item("t_DocDate").Specific.Value).ToString("yyyyMMdd")
                Dim str_DocDate As String = Date.Now
                Dim intStockRowCount As Integer = 0
                Dim FGCost As Double = 0
                Dim RMCost As Double = 0
                Dim RMQty As Double = CDbl(oDBDSHeader.GetValue("U_TotRW", 0))
                '---  RM Exist
                v_StockExit.Comments = "Stock Exit For Production Entry(RM) Production-Entry No: " & str_ProEntryNo
                v_StockExit.DocDueDate = str_DocDate
                v_StockExit.Reference2 = str_ProEntryNo
                intStockRowCount = 0
                For i As Integer = 1 To oMatrix1.VisualRowCount - 1
                    intStockRowCount += 1
                    If intStockRowCount > 1 Then v_StockExit.Lines.Add()
                    v_StockExit.Lines.ItemCode = oMatrix1.GetCellSpecific("ItemCode", i).Value
                    v_StockExit.Lines.Quantity = oMatrix1.GetCellSpecific("Qty", i).Value
                    v_StockExit.Lines.WarehouseCode = oMatrix1.GetCellSpecific("WarCode", i).Value
                    'v_StockExit.Lines.AccountCode = AccCode
                    Dim qty = oMatrix1.GetCellSpecific("Qty", i).Value
                    qty = IIf(qty.ToString.Trim = "", 0, qty)
                    Dim cost = oMatrix1.GetCellSpecific("Cost", i).Value
                    cost = IIf(cost.ToString.Trim = "", 0, cost)
                    Dim PerQtycost = CDbl(cost) / CDbl(qty)
                    v_StockExit.Lines.Price = PerQtycost 'GetItemPrice(oMatrix1.GetCellSpecific("ItemCode", i).Value)
                    Dim ManBtchNum = getSingleValue("Select ManBtchNum  from OITM Where ItemCode='" & oMatrix1.GetCellSpecific("ItemCode", i).Value & "'")
                    If ManBtchNum.Trim <> "N" Then
                        Dim rs As SAPbobsCOM.Recordset = GFun.DoQuery("select * from OBTQ where ItemCode ='" & _
                                                                      oMatrix1.GetCellSpecific("ItemCode", i).Value & _
                                                                      "' and WhsCode ='" & oMatrix1.GetCellSpecific("WarCode", i).Value & _
                                                                      "' And Quantity > 0 order by SysNumber")
                        Dim count As Double = oMatrix1.GetCellSpecific("Qty", i).Value
                        For k As Integer = 0 To rs.RecordCount - 1
                            If CDbl(rs.Fields.Item("Quantity").Value) >= count Then
                                Dim ss = rs.Fields.Item("SysNumber").Value
                                v_StockExit.Lines.BatchNumbers.BatchNumber = _
                                getSingleValue("select DistNumber from OBTN where ItemCode ='" & _
                                               oMatrix1.GetCellSpecific("ItemCode", i).Value & _
                                               "' and SysNumber ='" & rs.Fields.Item("SysNumber").Value & "'")
                                v_StockExit.Lines.BatchNumbers.Quantity = count
                                v_StockExit.Lines.BatchNumbers.Add()
                                Exit For
                            Else
                                v_StockExit.Lines.BatchNumbers.BatchNumber = _
                                getSingleValue("select DistNumber from OBTN where ItemCode ='" & _
                                               oMatrix1.GetCellSpecific("ItemCode", i).Value & _
                                               "' and SysNumber ='" & rs.Fields.Item("SysNumber").Value & "'")
                                v_StockExit.Lines.BatchNumbers.Quantity = rs.Fields.Item("Quantity").Value
                                v_StockExit.Lines.BatchNumbers.Add()
                                count = count - CDbl(rs.Fields.Item("Quantity").Value)
                            End If
                            rs.MoveNext()
                        Next
                    End If
                Next
                If oMatrix1.VisualRowCount > 1 Then
                    If v_StockExit.Add() <> 0 Then
                        StatusBarWarningMsg("Unable To RM Post Stock Document.......   " & oCompany.GetLastErrorDescription)
                        Return False
                    End If
                End If

  • How to generate new perner number using Abap Code in pa0002. what is the fu

    how to generate new perner number using Abap Code in pa0002. what is the function Module used.

    hi
    define internal number ranges for ur implementation then when u run PA 40  do not input any employee number , system will generate the employee number automatically.
    Regards
    sameer

  • How to generate a pulse on x number of events PCI-6602

    I am running LabVIEW 5.1 full development with a PCI-6602 counter board.
    I would like to generate an output pulse after counting x number of input pulses. I would also like to reset the counter with an external signal.
    My application is I am trying to generate a second index pulse for an encoder.
    I would like to count the pulses from encoder phase A and generate an output pulse on x number of counts. Then I would like to reset the counter using the encoder’s index pulse. This way I can change the phase of the “generated” index pulse with respect to the “real” index pulse by x number of counts (degrees) and maintain that regardless of encoder rpm.
    Thanks
    Brian

    Brian,
    There actually is a way to do what  you want, but it gets a little complicated.  I don't have LV on this machine so I'll have to just describe the idea.  First a summary: the counter will repeatedly countdown to 0.  Each time it reaches 0, it will generate a brief pulse which will in turn hw-reset the counter value to N.  Then it will countdown to 0 again, etc.  The same brief pulse could also be wired to a different encoder-measuring counter to create a "delayed" reset to 0 (or some other #).
    1. Configure your counter for "position measurement" instead of "simple event counting".  Set the encoder type to, um, I forget the name -- something like "two pulse encoder."  It's the setting that will increment with every SOURCE edge and decrement with every AUX edge.  Wire your encoder channel A to the counter's default AUX input (in position encoder mode, you must use the default input pins).  Hard wire from the default SOURCE input to GND.  Now every encoder edge will decrement the count, and nothing wlil ever increment it.
    2. Configure the counter to use z-indexing.  Set the z-index reload value to be N-1, where N is the # of encoder counts by which to delay the encoder's real z-index pulse.  Set the z-index reload phase appropriately, probably to A low B low.  Wire the real z-index pulse to the counter's GATE input.
    3.  Configure the counter to "pulse on terminal count" -- you do this using 'Counter Set Attribute.vi'.  So N encoder edges after the real z-index pulse, you'll generate a pseudo-z-index with this counter.
    4. You can wire this pseudo-z-index to the GATE input of the encoder-measuring counter.  Now the encoder's z-index pulse is delayed by an amount you can program.
    5. Note: this method requires the motion to be uni-directional.
    Good luck!
    -Kevin P.

  • How to generate serial number in group by sql

    I need the query output with record serial number by a group,
    Sr No by dept Dept Id Emp Name
    ========= ===== =======
    1 10 aaaaa
    1 11 abndddd
    2 11 sdfffffff
    3 11 s sdfe
    4 11 ggg
    1 12 dDEWQ
    1 13 xccc
    2 13 DSAFG
    How to generate the first column in the above output using sql?
    Thanks in advance
    Shrinivas

    use the analytic function ROW_NUMBER
    here is a small example
    SQL> select row_number() over(partition by deptno order by empno) rno, deptno, empno
      2    from emp
      3  /
           RNO     DEPTNO      EMPNO
             1         10       7782
             2         10       7839
             3         10       7934
             1         20       7566
             2         20       7788
             3         20       7876
             4         20       7902
             1         30       7499
             2         30       7521
             3         30       7654
             4         30       7698
           RNO     DEPTNO      EMPNO
             5         30       7844
             6         30       7900
    13 rows selected.

  • How to generate report with dynamic variable number of columns?

    How to generate report with dynamic variable number of columns?
    I need to generate a report with varying column names (state names) as follows:
    SELECT AK, AL, AR,... FROM States ;
    I get these column names from the result of another query.
    In order to clarify my question, Please consider following table:
    CREATE TABLE TIME_PERIODS (
    PERIOD     VARCHAR2 (50) PRIMARY KEY
    CREATE TABLE STATE_INCOME (
         NAME     VARCHAR2 (2),
         PERIOD     VARCHAR2 (50)     REFERENCES TIME_PERIODS (PERIOD) ,
         INCOME     NUMBER (12, 2)
    I like to generate a report as follows:
    AK CA DE FL ...
    PERIOD1 1222.23 2423.20 232.33 345.21
    PERIOD2
    PERIOD3
    Total 433242.23 56744.34 8872.21 2324.23 ...
    The TIME_PERIODS.Period and State.Name could change dynamically.
    So I can't specify the state name in Select query like
    SELECT AK, AL, AR,... FROM
    What is the best way to generate this report?

    SQL> -- test tables and test data:
    SQL> CREATE TABLE states
      2    (state VARCHAR2 (2))
      3  /
    Table created.
    SQL> INSERT INTO states
      2  VALUES ('AK')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('AL')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('AR')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('CA')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('DE')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('FL')
      3  /
    1 row created.
    SQL> CREATE TABLE TIME_PERIODS
      2    (PERIOD VARCHAR2 (50) PRIMARY KEY)
      3  /
    Table created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD1')
      3  /
    1 row created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD2')
      3  /
    1 row created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD3')
      3  /
    1 row created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD4')
      3  /
    1 row created.
    SQL> CREATE TABLE STATE_INCOME
      2    (NAME   VARCHAR2 (2),
      3       PERIOD VARCHAR2 (50) REFERENCES TIME_PERIODS (PERIOD),
      4       INCOME NUMBER (12, 2))
      5  /
    Table created.
    SQL> INSERT INTO state_income
      2  VALUES ('AK', 'PERIOD1', 1222.23)
      3  /
    1 row created.
    SQL> INSERT INTO state_income
      2  VALUES ('CA', 'PERIOD1', 2423.20)
      3  /
    1 row created.
    SQL> INSERT INTO state_income
      2  VALUES ('DE', 'PERIOD1', 232.33)
      3  /
    1 row created.
    SQL> INSERT INTO state_income
      2  VALUES ('FL', 'PERIOD1', 345.21)
      3  /
    1 row created.
    SQL> -- the basic query:
    SQL> SELECT   SUBSTR (time_periods.period, 1, 10) period,
      2             SUM (DECODE (name, 'AK', income)) "AK",
      3             SUM (DECODE (name, 'CA', income)) "CA",
      4             SUM (DECODE (name, 'DE', income)) "DE",
      5             SUM (DECODE (name, 'FL', income)) "FL"
      6  FROM     state_income, time_periods
      7  WHERE    time_periods.period = state_income.period (+)
      8  AND      time_periods.period IN ('PERIOD1','PERIOD2','PERIOD3')
      9  GROUP BY ROLLUP (time_periods.period)
    10  /
    PERIOD             AK         CA         DE         FL                                             
    PERIOD1       1222.23     2423.2     232.33     345.21                                             
    PERIOD2                                                                                            
    PERIOD3                                                                                            
                  1222.23     2423.2     232.33     345.21                                             
    SQL> -- package that dynamically executes the query
    SQL> -- given variable numbers and values
    SQL> -- of states and periods:
    SQL> CREATE OR REPLACE PACKAGE package_name
      2  AS
      3    TYPE cursor_type IS REF CURSOR;
      4    PROCEDURE procedure_name
      5        (p_periods   IN     VARCHAR2,
      6         p_states    IN     VARCHAR2,
      7         cursor_name IN OUT cursor_type);
      8  END package_name;
      9  /
    Package created.
    SQL> CREATE OR REPLACE PACKAGE BODY package_name
      2  AS
      3    PROCEDURE procedure_name
      4        (p_periods   IN     VARCHAR2,
      5         p_states    IN     VARCHAR2,
      6         cursor_name IN OUT cursor_type)
      7    IS
      8        v_periods          VARCHAR2 (1000);
      9        v_sql               VARCHAR2 (4000);
    10        v_states          VARCHAR2 (1000) := p_states;
    11    BEGIN
    12        v_periods := REPLACE (p_periods, ',', ''',''');
    13        v_sql := 'SELECT SUBSTR(time_periods.period,1,10) period';
    14        WHILE LENGTH (v_states) > 1
    15        LOOP
    16          v_sql := v_sql
    17          || ',SUM(DECODE(name,'''
    18          || SUBSTR (v_states,1,2) || ''',income)) "' || SUBSTR (v_states,1,2)
    19          || '"';
    20          v_states := LTRIM (SUBSTR (v_states, 3), ',');
    21        END LOOP;
    22        v_sql := v_sql
    23        || 'FROM     state_income, time_periods
    24            WHERE    time_periods.period = state_income.period (+)
    25            AND      time_periods.period IN (''' || v_periods || ''')
    26            GROUP BY ROLLUP (time_periods.period)';
    27        OPEN cursor_name FOR v_sql;
    28    END procedure_name;
    29  END package_name;
    30  /
    Package body created.
    SQL> -- sample executions from SQL:
    SQL> VARIABLE g_ref REFCURSOR
    SQL> EXEC package_name.procedure_name ('PERIOD1,PERIOD2,PERIOD3','AK,CA,DE,FL', :g_ref)
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    PERIOD             AK         CA         DE         FL                                             
    PERIOD1       1222.23     2423.2     232.33     345.21                                             
    PERIOD2                                                                                            
    PERIOD3                                                                                            
                  1222.23     2423.2     232.33     345.21                                             
    SQL> EXEC package_name.procedure_name ('PERIOD1,PERIOD2','AK,AL,AR', :g_ref)
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    PERIOD             AK         AL         AR                                                        
    PERIOD1       1222.23                                                                              
    PERIOD2                                                                                            
                  1222.23                                                                              
    SQL> -- sample execution from PL/SQL block
    SQL> -- using parameters derived from processing
    SQL> -- cursors containing results of other queries:
    SQL> DECLARE
      2    CURSOR c_period
      3    IS
      4    SELECT period
      5    FROM   time_periods;
      6    v_periods   VARCHAR2 (1000);
      7    v_delimiter VARCHAR2 (1) := NULL;
      8    CURSOR c_states
      9    IS
    10    SELECT state
    11    FROM   states;
    12    v_states    VARCHAR2 (1000);
    13  BEGIN
    14    FOR r_period IN c_period
    15    LOOP
    16        v_periods := v_periods || v_delimiter || r_period.period;
    17        v_delimiter := ',';
    18    END LOOP;
    19    v_delimiter := NULL;
    20    FOR r_states IN c_states
    21    LOOP
    22        v_states := v_states || v_delimiter || r_states.state;
    23        v_delimiter := ',';
    24    END LOOP;
    25    package_name.procedure_name (v_periods, v_states, :g_ref);
    26  END;
    27  /
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    PERIOD             AK         AL         AR         CA         DE         FL                       
    PERIOD1       1222.23                           2423.2     232.33     345.21                       
    PERIOD2                                                                                            
    PERIOD3                                                                                            
    PERIOD4                                                                                            
                  1222.23                           2423.2     232.33     345.21                       

  • For sweden the employee number range is completed Eg:23000000 to 239999999 now how to generate next employee id

    For sweden the employee number range is completed Eg:23000000 to 239999999 now how to generate next employee id

    Hi Bharathi,
    If required no ranges are not there which you want to add then will not be problem and you can extend the 23999999 to your next limit like 39999999 check the overlapping.
    Check extended no rage are present in the system and then system would not except because of overlapping.
    Check and tell.
    Regards,
    Sankarsan

  • How to generate a  number sequence for a column of a Z*table?

    Hi ,
    How to generate a  number sequence for a column of a Z*table?
    plz guide me.
    thanks
    Albert

    1) Use SNRO for defining a number range.
    2) Use FM NUMBER_GET_NEXT for getting the next number with object, sub object etc..
    See one example below.
          CALL FUNCTION 'NUMBER_GET_NEXT'
            EXPORTING
              nr_range_nr                   = c_01
              object                        = c_z_prd_code
    *           QUANTITY                      = '1'
             subobject                     = p_vkorg
    *           TOYEAR                        = '0000'
    *           IGNORE_BUFFER                 = ' '
           IMPORTING
             number                        = in_prd_code
    *           QUANTITY                      =
    *           RETURNCODE                    =
            EXCEPTIONS
                  interval_not_found            = 1
                  number_range_not_intern       = 2
                  object_not_found              = 3
                  quantity_is_0                 = 4
                  quantity_is_not_1             = 5
                  interval_overflow             = 6
                  buffer_overflow               = 7
                  OTHERS                        = 8
    3) You may write these code in main program of the table maintinence
    rgds,
    TM.

Maybe you are looking for

  • Need help, MMC tree got deleted, very urgent.

    Hi, My sap MMC tree, got deleted in the server. I have been trying to restore since 2 days and couldnt succeed, please help me. 1) i have uncared the sapmmc.sar from   Kernal\NT\I386\MMC\sapmmc.sar file 2) i got about 7 files, in which there is one s

  • Unable to install os x update, just purchased iMac

    Unable to install os x update, just purchased iMac

  • Safari & Gmail Chat

    Gmail added a new feature recently which lets you chat with other gmail users who are on, and log your chats. Unfortunately, this does not work in Safari. Anyone have any idea why, is it just something Apple needs to update? On Firefox the new window

  • Connection MESG and INOB with additional field

    Hi friends, i'm beginner in ABAP and for this reason i create reports in ABAP query. So i create query between tables MSEG and INOB (then INOB with AUSP). In INOB-OBJEK - value is matnr and charg, but value in this field is: for example  matnr       

  • Need explanation on the below behavior of rownum.

    Hi, I have a normal table employee with 4 columns(id,name,age,salary). I am using the below queries on it. What is the reason that query 1 and 4 gives value whereas 2 and 3 doesn't?? Can someone explain this behaviour of rowwnum? 1) select rownum,emp