How to process next record in oracle PLSQL

Hi,
I am processing below record set with the help of BULK COLLECT in Oracle PLSQL Procedure. While processing I am checking model is one that need not be substituted. If it is 'NA' or 'N/A', I need process next record (marked as bold in code snipet)
Please guide me how to do it ?
TYPE t_get_money IS TABLE OF c_get_money%ROWTYPE INDEX BY BINARY_INTEGER;
L_money t_get_money ;
L_subst_model VARCHAR2(40);
L_Notify_Manager     VARCHAR2(1);
L_grade          VARCHAR2(20);
L_Error_Message     VARCHAR2(1);
BEGIN
OPEN c_get_money ;
FETCH c_get_money BULK COLLECT INTO L_money ;
CLOSE c_get_money;
FOR I IN 1..L_money.count LOOP
-- check if the model is one that need not be substituted
IF (upper(L_money(i). subst_model) in ('N/A', 'NA')
THEN
L_NOTIFY_MANAGER(I) := 'Y';
L_GRADE(I) := 'ERROR';
L_error_message(i) := 'substitute Model is not N/A or NA' ;
-------Here I want to process NEXT RECORD--------
END IF ;
END;

One of the solution for below version of 11g...
DECLARE
     TYPE t_get_money IS TABLE OF c_get_money%ROWTYPE
                                   INDEX BY BINARY_INTEGER;
     L_money              t_get_money;
     L_subst_model        VARCHAR2 (40);
     L_Notify_Manager   VARCHAR2 (1);
     L_grade              VARCHAR2 (20);
     L_Error_Message    VARCHAR2 (1);
BEGIN
     OPEN c_get_money;
     FETCH c_get_money
     BULK COLLECT INTO L_money;
     CLOSE c_get_money;
     FOR I IN 1 .. L_money.COUNT LOOP
          IF UPPER (L_money (i).subst_model) IN ('N/A', 'NA') THEN
               GOTO Nextrecord;
          END IF;
          L_NOTIFY_MANAGER (I)   := 'Y';
          L_GRADE (I)              := 'ERROR';
          L_error_message (i)    := 'substitute Model is not N/A or NA';
        <<Nextrecord>>
          NULL;
     END LOOP;
END;One of the solution for 11gR1 and above...
DECLARE
     TYPE t_get_money IS TABLE OF c_get_money%ROWTYPE
                                   INDEX BY BINARY_INTEGER;
     L_money              t_get_money;
     L_subst_model        VARCHAR2 (40);
     L_Notify_Manager   VARCHAR2 (1);
     L_grade              VARCHAR2 (20);
     L_Error_Message    VARCHAR2 (1);
BEGIN
     OPEN c_get_money;
     FETCH c_get_money
     BULK COLLECT INTO L_money;
     CLOSE c_get_money;
     FOR I IN 1 .. L_money.COUNT LOOP
          IF UPPER (L_money (i).subst_model) IN ('N/A', 'NA') THEN
               CONTINUE;
          END IF;
          L_NOTIFY_MANAGER (I)   := 'Y';
          L_GRADE (I)              := 'ERROR';
          L_error_message (i)    := 'substitute Model is not N/A or NA';
     END LOOP;
END;

Similar Messages

  • How to process each records in the derived table which i created using cte table using sql server

    I want to process each row from the CTE table I created, how can I traverse from first row to second row and so on....
    how to process each records in the derived table which i created using  cte table using sql server

    Ideally you would be doing a set based processing rather than traversing row by row as thats more efficient. To answer it specific to your scenario we may need more info. Can you explain with some sample data your exact requirement?
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Triger for display next record in oracle forms

    hai all,
    i want to do
    when new form opened i have to add new reord that is empty new form also my new rownum will be displayed.
    now i getting first record.
    like:
    GROUP_ROWNUM:     1
    GROUP_ID:      120130
    GROUP_NAME aaaaaaaaa
    need like:
    GROUP_ROWNUM:     7
    GROUP_ID:
    GROUP_NAME
    that can be done by
    trigger for display next record in oracle forms?
    or through property seting?
    thanks in adv,
    rcs
    --------

    YES, this block is base on the DB table
    through defualt navigational button i can go to next,last,new record
    but i want create seperate form for new entry, in that i want to display
    old rownum
    formula to get rownum automatically (i am not at all typing it is system generated)
    even though i created column group_rownum for rownum
    (i can't be typing)
    LAST_RECORD;
    NEXT_RECORD; also not getting the next rownum
    i hope now understand me
    any posible way?
    thank you for your good input
    i.e.
    SQL> DESC GROUP_MSTR1;
    Name Null? Type
    GROUP_ID NOT NULL NUMBER(10)
    GROUP_NAME NOT NULL VARCHAR2(30)
    SQL> select * from GROUP_MSTR1;
    GROUP_ID GROUP_NAME
    123 AAAAAA
    124 BBBBBBBB
    125 CCCCCCCCC
    126 DDDDDDDD
    1 eeeeeeee
    2 FFFFFFFFF
    3 ggggggg
    7 rows selected.
    SQL> select rownum, GROUP_ID, GROUP_NAME from GROUP_MSTR1;
    ROWNUM GROUP_ID GROUP_NAME
    1 123 AAAAAA
    2 124 BBBBBBBB
    3 125 CCCCCCCCC
    4 126 DDDDDDDD
    5 1 eeeeeeee
    6 2 FFFFFFFFF
    7 3 ggggggg
    7 rows selected.
    -------------

  • How to process NAST record.....

    Hi all,
        can anyone tell me how to process Nast record with dispatch time 3 : send periodically with own transaction and with dispatch time 2.
    thanks in advance.
    vinod.

    I think you can process using program RSNAST00
    Regards
    MD

  • Trap error within loop and process next record

    Hi,
    I am processing each record inside a loop. Now if any exception occurs processing with a single record within loop I want to continue with the next record with proper error message in the log.
    How to achieve the above scenario? Shall I create a savepoint and whenever any error occurs inside the loop I will rollback to that savepoint. Once it is done shall it process the next record automatically?
    Thanks in advance for your reply.
    Thanks,
    Mrinmoy

    Relational databases are about sets.
    They are not about files and records
    Processing records in a loop will make your code slow, and you should avoid using this strategy.
    That said
    Simply enclose the code in it's own begin end block.
    beginn
    <your code>
    exception
    when <your exception> then
    <process the exception not reraising it>
    end;
    No savepoints required.
    Sybrand Bakker
    Senior Oracle DBA

  • How to commit each record in Oracle Form Personalization

    Hi,
    how to commit each record with out using save button in form...my requirement is when cursor goes to next record it vil automatically stored in database please give me your valuable suggestion...
    Actual Requirement:
    here we need to give the locators(it is  number) whenever the cursor goes to next record it vil automatically incremented by 1(i wrote query for incremetation) and previous one vil be stored in database.
    Here i am using WHEN NEW ITEM INSTANCE IS USED Trigger..
    Thank You,
    Regards,
    Putta

    Hi,
    The commit should be done by the form, or whatever raises the business event.
    The API fires the event in the same transaction (unless the subscription is deferred), and then the commit is issued. This commits the transaction, and all actions of the event subscription.
    If the subscription is deferred, then the concurrent request which processes the subscription will issue the commit on completion.
    HTH,
    Matt
    WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
    Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
    Have you read the blog at http://thoughts.workflowfaq.com ?
    WorkflowFAQ support forum: http://forum.workflowfaq.com

  • How to access next record from database on to form

    hi
    i have written the following piece of code to retrieve data from database oon to form...
    Try
                rset = oDICompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                query = "Select * from [@TEST]  where Code =  ('" + oform.Items.Item("6").Specific.value + "') "
                rset.DoQuery(query)
            Catch ex As Exception
                SBO_Application.MessageBox(ErrorToString)
            End Try
            '  oform.Items.Item("6").Specific.value = rset.Fields.Item("Code").Value
            oform.Items.Item("7").Specific.value = rset.Fields.Item("Name").Value
            oform.Items.Item("8").Specific.value = rset.Fields.Item("U_Sal").Value
    but i can see only one record on my form controls.... i have placed on more button called " Next" so that i can access next records from DB when i click on "Next" button...
    Public Sub NextRecords()
    Try
         rset.MoveFirst()
                While Not rset.EoF
                 '   oform.Items.Item("6").Specific.value = rset.Fields.Item("Code").Value
                   oform.Items.Item("7").Specific.value = rset.Fields.Item("Name").Value
                  oform.Items.Item("8").Specific.value = rset.Fields.Item("U_Sal").Value
                   rset.MoveNext()
                End While
                rset.MoveNext()
          Catch ex As Exception
               SBO_Application.MessageBox(ErrorToString)
          SBO_Application.MessageBox("Updated")
           End Try
    End sub
    i'm not able to access next records...
    plz provide me the solution and code for this how to handle this scenario....

    From your question and code sample given, I think the problem is you are seeing only the last record when pressing the next button.
    In the Next button press, you are coded such a way that it will populate the last record.
    Try removing the do..While.. loop and simply code like
    if Not rset.EoF
    rset.MoveNext()
       oform.Items.Item("6").Specific.value = rset.Fields.Item("Code").Value
       oform.Items.Item("7").Specific.value = rset.Fields.Item("Name").Value
       oform.Items.Item("8").Specific.value = rset.Fields.Item("U_Sal").Value
    end if
    So when you click next, you can see the next record. Not the last record.
    Anoop

  • How to get next record using next  button

    my database is very large and i awnt to display results 1 page at a time by keeping next button.so when i click next i should get next record.
    help me out

    Re-direct this post under relevant Developer Tools Forums.
    http://forums.oracle.com/forums/category.jspa?categoryID=19
    Regards,
    Sabdar Syed.

  • How to execute a function in oracle plsql object, when object dies

    I have a plsql object with a member function as exec_last.
    I want this procedure to be called when plsql object is cleaned or when the session hosting this object dies.
    In C, we have a system call as atexit(). Is there any such feature in Oracle 10g or any workaround using embedded java.
    This feature is required to flush the contents stored in plsql table in the object to the database, when program exits.
    Thank you,
    Warm Regards,
    Navin Srivastava

    navsriva wrote:
    Is there any better way to implement this in memory caching. What is the buffer cache of Oracle? It is exactly that - a memory cache for data blocks. Both new blocks (created by inserting new rows) and existing blocks (used by selects, updates and deletes, and re-used (freespace) by inserts).
    The Oracle buffer cache is a very mature and sophisticated cache. Attempting to do it "+better+" than the db buffer cache in another software layer (like PL/SQL) is mostly a waste of time and resources.. and invariable introduces another s/w layer that simply increases the number of moving parts. This in turn usually means increased complexity and slower performance.
    Why use bulk processing in PL/SQL? The basic and fundamental answer to that is to decrease the context switching between the PL engine and SQL engine.
    When running PL code to insert data into SQL, that data needs to be passed to the SQL engine, the PL engine needs to perform a context switch to the SQL engine to allow it to process that data and perform the SQL instruction.
    If there are a 1000 rows to inserts, it means a 1000 context switches.
    Bulk processing makes the "+communication/data pipe+" between the two bigger. Instead of passing a single row's data to the SQL engine via a context switch, a bulk collection/array of a 100 rows is passed. There is now a mere 10 context switches required to push that 1000 rows from the PL engine to the SQL engine.
    You can do the same from any other SQL client... (remember, that PL itself is also a SQL client). You can, using C/C++ for example, do the exact same thing. When passing row data to the SQL engine to insert, pass a collection of a 100 rows instead of the data for a single row.
    The exact same benefits result as in PL/SQL. A bigger communication pipe, allowing more data to be transferred to/from the SQL engine, resulting in less context switching.
    Of course, a context switch ito C/C++ is a lot more expensive than in PL/SQL - as the PL engine sits in the very same physical process as the SQL engine. Using C/C++, this will usually be a separate process communicating with the SQL engine process across the network.
    The same applies to other languages, like Java, C#, Delphi, Visual Basic and so on.
    It does not make sense to introduce another s/w layer, the PL/SQL engine, and have the client "+insert+" rows into its memory structures... and then use the PL engine to "+flush"+ that to the SQL engine via a bulk process command.
    It will be faster, and more scalable, having the client language using bulk processing directly and dealing with the SQL engine directly.
    Simple example. What does the SQL*Loader program (written in C) use? It does not use PL as a proxy for moving data from a CSV file into a SQL table. It calls SQL directly. It uses bulk processing. It is very fast at loading data.
    There is an exception to this. When PL is used as a business processing and validation layer. Instead of the client code implementing that logic, it is done using PL. The client then no longer will manually add an invoice to the INVOICES table for example. It instead calls the AddNewInvoice PL/SQL procedure - and this procedure does all. It checks the customer code as valid. Ensures that there's stock available of the products being ordered on the invoice. Etc.
    But in this scenario, PL is not used a secondhand "buffer cache". It is used for what it has been designed for - a proper application layer inside the database.

  • How to process million records

    Hi ,
    How would you process 50 million records without running out of set background time in BDC . please help is there any other process for doing this.
    Moderator message: too vague, help not possible, please describe problems in all technical detail when posting again.
    [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]
    Edited by: Thomas Zloch on Dec 9, 2010 9:40 AM

    Hi,
    I am not sure but please check below given link might be it will useful for you.
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/c0d1e9c4-bfb4-2c10-76b4-d5e2912b83be
    Thanks,
    Jaten Sangal

  • How to return multiple record with Oracle Native Web Service?

    Dear all,
    I would like to know that the oracle native web service can be able to return multiple records to client or not?
    I successfully developed the oracle native web service for returning single record but the next challenge is to develop web service in order to return multiple record (like Employees data base on each department)
    Thank and Regards,
    Zenoni

    I successfully developed the oracle native web service for returning single record but the next challenge is to develop web service in order to return multiple record (like Employees data base on each department)You could return a list (multiple values/records) in XML format (using XMLType or CLOB), or CSV, or JSON, or whatever.
    function get_employees (p_department_id in number) return clob
    as
    begin
      return 'your_xml_string_here';
    end get_employees;It would be up to the client (the caller of the web service) to extract the values from whatever format you decide upon, of course.
    - Morten
    http://ora-00001.blogspot.com

  • How to connect Weighing machine to Oracle plsql or Oracle Apex

    Hi,
    I am working on Oracle Apex and plsql, I want to know how can i connect a weighing machine to my application.
    Please suggest me.
    Thanks in advance.
    Vinod

    Hi;
    There is dedicated forum site for apex. Please close your issue here as answered than move your issue Forum Home » Database » SQL and PL/SQL or Forum Home » Database » Application Express which you can get more quick response
    Regard
    Helios

  • How to Process flat File in Oracle Apps through Concurrent Program

    Hello Everyone,
    My client has a request, to process a bank file (Lockbox) which is a flat file that will be copied on UNIX box and I will have to create a new concurrent request that will process this flat file and will update receipt information in Oracle Apps database tables.
    Could you please suggest, if there are any other standard Oracle Apps functions (Example FND) available which can be used through Concurrent program that can be used to open a file from a particular directory and can be read from the flat file and after processing this file can be closed.
    Please let me know, if you have a small example, that would help me a lot.
    Thanks

    There are base concurrent programs in Accts Receivable that do consume lockbox flat files. Pl see the AR Setup/User Guides at
    http://download.oracle.com/docs/cd/B40089_10/current/html/docset.html
    Srini

  • How to update multiple records in Oracle ?

    Hi Guys,
    <b>I have to update multiple records from a file into Oracle Table...</b>
    I can successfully insert the multiple records into the table but can't update the multiple records into the table.
    when i am using UPDATE_INSERT only my first record of the file is getting updated in th e table..
    Please share your views with me.
    Regards,

    I solved it by making changes in the occurrence  parameter of data type ...:-)

  • How to insert new record into oracle table from GridView in VS2005.

    I need to insert records into Oracle10g table from VS2005 GridView using the Insert Method in Business Logic Class. The Update and Delete Methods are working fine. What's the best way out?

    How is it "not possible"?
    Either modify the Class for the new fields, or give the new fields default values (if applicable). If the type of an existing column has changed, then only the first option is available.
    Where's the problem?

Maybe you are looking for

  • Creation of Reports in SD

    Hi, Based on client requirement, I would like to know how do we create reports which is very customised for eg : A report that talks about the list of sales orders for the quarter July - Sep that also shows the customers with the highest number of or

  • Pricing: Special Free-Of-Charge processing for Portugal

    Hello, First I will explain a legal portuguese requirement regarding VAT in free-of-charge (FOC) items: 01 - If the internal value of an FOC item is < 50 EUR, there is no VAT determined. 02 - If the internal value of an FOC item >= 50 EUR, then VAT h

  • Error Message in iTunes Producer for updated iBook

    I was attempting to upload an updated version of a free book I'd created using iBooks Author. Adding the new .ibooks file to the ITMSP package went fine, and I was told it was a valid asset, but when I hit "Deliver," I got this error message: ERROR I

  • HTML client & Sharepoint 2013

    When I change Sharepoint settings in the project from one Sharepoint server to another, I always get the message  Value cannot be null. Parameter name: sharePointHostData Description: An unhandled exception occurred during the execution of the curren

  • Not able to see any mail on machine or iCloud suddenly, just stuck. Help!

    Mail app on machine showing @mac emails in list but stuck downloading them. Any help would be great! (Other clients are fine) Same problem when I log onto iCloud, just stuck.