How to handle success/fail chains

I'm still getting the hang of this LabView programming style and have found a repeating (and annoying) design pattern that I'm sure others have encountered.  I have a long series of steps to perform.  Each step is a prerequisite of the next step and each could fail.  So I've found myself creating these massive nested case structures so that step 2 only gets called if step 1 succeeds, step 3 only if step 2 is OK, etc.  YUCK!
What is the Right Way to handle a chain like this?
Thanks,
Keith.

Vi's only begin executing when all their inputs are satisfied, right? Well, make use of that by paying attention to all the data your VIs can generate - or might need.
Say you have three VIs (A, B and C) that need to execute in the order listed. What information does A output that B would need? Regardless of exactly what A and B do there is one piece of information that will be there 90% of the time. I am speaking of status. A needs to let what comes after know whether an error occurred during its processing. Likewise B needs to know if an error occurred before it started.
The mechanism that LV provide for this status communications is the Error Cluster. It contains a boolean that serves as a basic error flag (T = error, F = no error); a numeric that can hold a general error code to specify in general what the problem is, and a string that you can put as much information as you want to identify the issue.
Stringing VIs together using the error clusters is an excellent way of structuring linear code - and can make your applications more robust. At least 90% of LV programs that appear to "lock-up" or "freeze" are due to errors that don't get reported.
Mike... 
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

Similar Messages

  • How to handle delta failed process chain steps

    Hi All,
    I have a query regarding process chains were in processstep has delta load and there is dependency between the predeseccor and successor process steps,then
    if the delta load fails due to any one of the following reasons
    1) due to remote_icp locked the prtclr Infoobject the process step is executing .
    2) due to any psa records errors and so on
    Then how to handle delta and see that correct delta records were updated .
    Because again for the nextday loads if the previous delta is incorrect it will give pop-up message that it is not possible.
    If any suugestions pl guide me.
    thanks
    Venkat
    [email protected]

    1)Remove the lock by force from sm12 or wait till the lock is gone.Then see if the delta data has come till the PSA.Mark failed delta load RED and back it out from target.Then read everything in manually from PSA to target.
    In process chains u can go the monitor entry for the failed load by..highlight chain..click log icon..give selection..for proper selection..see the failed node..right click..display messages..click on process monitor.
    Sometimes even if infopackage is run successful manually,next steps in the chain do not kick off.
    Use Siggi's excellent blog on this..(it works really well)
    /people/siegfried.szameitat/blog/2006/02/26/restarting-processchains
    2)Make request RED and back it out from target.
    Correct records in the PSA and read everything in manually from PSA to data target.
    Then use Siggi's blog.
    If data hasnt come to PSA do a delta repeat.
    Always check yesterday's chain run about 1-2 hrs before today's chain kicks off.
    cheers,
    Vishvesh
    Message was edited by: Vishvesh

  • How to handle the failed records from the table when using DB Adapter

    Hi,
    I am reading some records from table using DB Adapter inside my synchronous BPEL process. Say like reading 100 records from table in between after successful reading of 90 records an error occured in 91st record due some various reasons(like DB down, Connection interrupted etc.). Then how to handle this situation, whether i have to read all the records from the begining and is there any option to continue from where it stopped reading.
    Can please anybody help me out in the regard?
    Thanks in advance
    Regards,
    Aejaz

    we had the same requirement some time ago and had two option:
    1. ask the R/3 development team add a deletion indicator in the table (and thus not actually deleting the record). this deletion indicator could then be used like for any other standard datasource
    this option was however refused, due to huge data volume after a while
    2. at the end of the load we copied the ZTABLE1 to ZTABLE2. then in the begin of the load (day after) we compare the data of table1 to table2. entries available in table2 but not in table1 are deleted, and we put a 'D'. in deletion indicator; as we only keep the deleted entries for one day, the volume of the new table is acceptable.
    M.

  • How to handle "Validation failed for the field - Tax code" issue?

    We had mass uplaod the order that create on Mar with tax code effective date on Apr. Now we would like return on this order  and getting error of "Validation failed for the field - Tax code". How to handle this issue?

    Hi
    You will have to check if the Tax_Code of RMA being received is the same as the one in the related sales order.
    If not you will need to use the same tax_code.
    Refer below document : Doc ID 1584338.1

  • How to handle a failed transaction in Syclo Agentry SAP Work Manager 5.3

    Hello Experts,
    I have a transaction created on work order time entry.
    For some reason, when the transactions fails (when clicked on transmit button), the transmit stops as soon as the error is thrown from ECC.
    However, this transaction remains on the client and is not deleted.
    when a new transaction is created on another object and transmitted, it still retains the previously failed transaction and tried to transmit it again.
    Because of this, the transmit stops again and it fails.
    Is there anyway to remove a transaction which has failed already? What is the best way to handle such scenario.
    Thanks for the help!
    Best,
    Arihant Kothari
    Message was edited by: Michael Appleby

    Arihant,
    The Error handling within the application / editor does not have a one click type solution to just remove a pending transaction.   As Jason mentioned the behavior is to stop when an error occurred so the user can correct and continue.  In some cases this may mean removing the transaction through the removal of the associated object from the mobile device (clear option frequently) that when the object is cleared the associated transaction is also deleted allowing the pending transactions behind the current one to proceed.
    The editor allows for error handling steps to be defined to execute upon error so that potentially you could log the transaction data off to the side for handling later and then continue processing.  This of course requires there to be manual back office involvement monitoring the logged data for resolution and next steps.
    --Bill

  • I recently purchased a movie (Prometheus) on my computer through iTunes and every time I try to put it on my iPhone, it fails. How can I successfully sync this video? Mind you, every other file syncs flawlessly.

    I recently purchased a movie (Prometheus) on my computer through iTunes and every time I try to put it on my iPhone, it fails. How can I successfully sync this video? Mind you, every other file syncs flawlessly.

    Can you connect to a wifi source on the device? Enable wifi in settings on the device itself. If you don't have wifi at home, there may be a local hotspot you can use for this.
    The reason this happens is carriers don't want people downloading huge files that would slow their network as well as eat up your data plan.

  • Error handling in process chain-doubts

    Hi ,
    I have some doubts in error handling of process chains.
    1) I have  aprocess load infopackeage and subsequent process is update fromPSA.
    process load infopackage got failed  , so i loaded  the IP manually and repeated the next i.e process update from PSA .
    How to correct the process chain from now?
    2) I have  aprocess load infopackeage and subsequent process is Delete request in infocube .process load infopackage got failed  , so i loaded  the IP manually and repeated the next process i.e Delete request in infocube. Chain continued by deleting the right request . How this is possible ?
    Plz  help me  as this is urgent and daily i have to deal with this  issues. If any documents on error handling is greatly appreciated.
    My mail id is [email protected]
    Regards,
    Pavan

    Hi Pavan,
    Hope the following links will give u a clear idea about process chains and clear ur doubts.
    Business Intelligence Old Forum (Read Only Archive)
    http://help.sap.com/saphelp_nw2004s/helpdata/en/8f/c08b3baaa59649e10000000a11402f/frameset.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/8da0cd90-0201-0010-2d9a-abab69f10045
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/19683495-0501-0010-4381-b31db6ece1e9
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/36693695-0501-0010-698a-a015c6aac9e1
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9936e790-0201-0010-f185-89d0377639db
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3507aa90-0201-0010-6891-d7df8c4722f7
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/263de690-0201-0010-bc9f-b65b3e7ba11c
    /people/siegfried.szameitat/blog/2006/02/26/restarting-processchains
    Errors in monitoring of process chains can be categorized into 4 different sections...
    Master data - Full Update
    Master data - Delta Update
    Transaction data - Full Update
    Transaction data - Delta Update.. in terms of loading of data which can be due to server shut down or system maintenance... errors due to incorrect entries in the OLTP system in which case you'll have to fix the errors in the PSA and manually load the data...
    Otherwise it can have errors on Attribute change run being locked by some other job... Aggregate Roll up failing because of attribute change run being run at the same time... Problem with hierarchies and save hierarchies...
    There can be problems with the data store activation if the ODS object contains any incorrect request sitting inside it... then, you need to delete the incorrect request and reload the data again...
    In case of Transaction Delta failure, you'll have to request for a repeat either manually in the infopackage or using the repeat option if available on right clicking the load event...
    For Master Data Delta failures, you need to do an Re-init by deleteing the previous initalization condition in the "initalization option for source systems" in the menu scheduler or reschedule the enitre chain... because, master data generally do not support repeat of last delta ...
    U can even look into these links:
    /people/siegfried.szameitat/blog/2006/02/26/restarting-processchains
    For common data load errors check this link:
    /people/siegfried.szameitat/blog/2005/07/28/data-load-errors--basic-checks
    ****Assign Points if Helpful****
    Regards,
    Ravikanth.

  • How to Handle SAP SUS XML Acknowledgment

    Hi folks,
    I have a scenario here where the SAP R/3 system sends a Purchase Order document to SAP SUS through a SAP XI Mapping.
    After processing the P.O. document, the SAP SUS system, automatically, returns a Acknowledgment message (ns: http://sap.com/xi/XI/Message/30) to SAP XI.
    I need to implement a BPM scenario where SAP XI processes this Acknowledgment message and Logs it into my Monitor System (JDBC Adapter). Actually, the SAP XI needs to send to my Monitor System the status (Success or Fail) of the P.O. processing by SAP SUS.
    How can I handle this Acknowledgment message with a BPM Scenario? Is it possible?
    Best Regards,
    Nascimento

    Hi Thiago,
    Currently in BPM you can do this with ASYNC-SYNC Bridge design.
    You can not dirrectly access the content of the ACK, however the BPM shows different behaviours based on the ACK status. E.g. if the ACK contains a success message the BPM will continue in its normal process, if the ACK contains a permanent error, it will either stop or go through an exception branch (provided such a branch has been defined). Have a look at the documentation: http://help.sap.com/saphelp_nw04/helpdata/en/43/65ce41ae343e2be10000000a1553f6/content.htm It doesnt"t state the above mentioned behaviour in detail but says that you need to define an exception branch.
    The trickiest part is always to find out, when you will get a transient vs. as permanent error ack. If you are using ACKs with Proxies refer also to this link http://help.sap.com/saphelp_nw04/helpdata/en/29/345d3b7c32a527e10000000a114084/content.htm and this http://help.sap.com/saphelp_nw04/helpdata/en/f4/8620c6b58c422c960c53f3ed71b432/content.htm
    Receiver adapters that run on the Adapter Engine support system acknowledgments if they are requested by the sender. Acknowledgements are triggered when a message is successfully processed by the adapter or if an error occurs while it is being processed. Receiver adapters do not support application acknowledgments. The RNIF and CIDX adapters are exceptions to this rule, since they also support scenario-dependent application acknowledgments. Sender adapters of the Adapter Engine do not request any acknowledgments.
    However IDoc adapter is requesting application acks. Therefore you have to disable acks for this scenario using report IDX_NOALE.
    Also go through these documents for any further help:
    http://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-how-to-guides/how%20to%20handle%20acknowledgments%20for%20idoc.pdf
    http://help.sap.com/saphelp_nw04/helpdata/en/6a/e6194119d8f323e10000000a155106/content.htm
    Also refer the guide: "How To Handle Acknowledgments for IDoc"
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f6d2d790-0201-0010-9382-b50b499b3fbe
    Regards,
    Abhy
    Message was edited by: Abhy Thomas

  • How to handle stored procedure response having multiple queries

    Hi Friends,
    While working in JDBC to RFC scenario,I faced an issue that my stored procedure is having multiple SQL queries in it. First Select and then update and again some select options.So,how to handle the response of the stored procedure. I read that while using sender JDBC
    " db.processDBSQLStatement=<SQL-Select-Statement>
    Either specify a valid SQL SELECT statement to select the data to be sent from the specified database, or specify an SQL EXECUTE statement to execute a stored procedure that contains exactly one SELECT statement  "
    So, please suggest me is there any other way to catch the output of the stored procedure.Because, if select statement is working fine but if any other quires fails then data inconsistencies can happen.Kindly help me out.
    Thanks and Regards,
    Nutan

    Hi nutan,
    >>Already exception is handled in SP.But,issue is that select will never fail so, sender adapter will get the resultset from select and continue process.But if later any other query fails in SP adpter wont be getting any response.
    Along with exception you need to handle the case when some other query fails. A SP is like a procedure which will do a certain list of activities before providing the output. So during this activity if some query fail then you can send back the response with a message!!!! And in XI handle this error (by routing it to some error receiver etc)
    >>I need to try something like creating a temporary table and inserting the resultset of slect statement in that. and perform all other operations and after successful completion of all the queries.Again i want to get all the values from the temporary table. So,whether I can write such query in the sender communication channel.Please suggest me for this.
    Approach looks ok, but think of the delay for JDBC sender adapter. IT will invoke your SP and will wait for it to fill a table and do all the processing. I guess this may become a issue for you.
    Check on the frequency of this interface and message size before taking this design approach
    Regards
    Suraj

  • How to handle empty Dats field received from SAP RFC response

    Hi All,
    I am invoking a SAP RFC which gives me a Dats field in response.
    A valid dats fields is successfully received by my pipelines.
    But when an empty Dats field is received, My pipeline fails and i get error.
    How to handle the empty Dats field from SAP

    Hi Anant,
    This is because the legacy SAP adapter accepted RFC messages with date field empty. In the new version, the same call results in an error. WCF-SAP adapter doesn't allow blank XML nodes.
    You need to use the below custom pipeline component as a workaround.
    Refer:
    Pipeline component for enabling legacy behavior in WCF-SAP adapter.
    Rachit
    Please mark as answer or vote as helpful if my reply does

  • How to debug completed Process chain

    Hi Experts,
    Can you please let me know how to debug completed Process chain.
    In my Process Chain, we have one ABAP step to update Z-Table entries.
    But it was updated wrong entry into Z-Table.
    Now i want to debug ABAP step in Process chain which was completed successfully (This is Monthly load).
    I have tried to debug the back ground job but it throws an error message in middle of the debugging.
    Could you please tell me how to debug ABAP step in completed Process Chain.
    Thanks
    Shaik

    http://help.sap.com/saphelp_nw04s/helpdata/en/8f/c08b3baaa59649e10000000a11402f/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b0afcd90-0201-0010-b297-9184845346ca
    http://help.sap.com/saphelp_nw70/helpdata/en/21/15843b74f7be0fe10000000a114084/frameset.htm
    /people/vishvesh.bahirat/blog/2006/11/29/bw-process-chain-design
    http://help.sap.com/saphelp_nw70/helpdata/en/21/15843b74f7be0fe10000000a114084/frameset.htm
    1.Go to RSPC to view all the chains.
    2.There click on any chain which you want to run/view.
    3.Click on the log view(shift+F1) to view all the previous runs of the chain and whether they have failed or successful(here you can select 1 day,week ,month etc in the display range)
    4.If you want to modify the chain /add a process type /change the variant then click (Ctrl+F9) and do the changes.
    Even you can change the start variant in change mode for manual scheduling>right click on start process typeselect display variant--now select start Direct Scheduling/ API or Metachain
    under direct scheuling option you can trigger it by setting start immediately /Date-time/After job/event whatever you want to do
    Else you can make it part of a Metachain consisting of different such small local process chains.
    Now Click on Schedule (F8) to run this chain manually.
    5.For Monitoring use Tcodes SM37/RSPCM/SM50
    Also you can use BWCCMS.
    I usually prefer sm37 to view all the background jobs but SM50 is also useful.
    6.debug loop can be used to debug a process chain.(you have to specify here the gap between one event been triggered and the next subsequent process starting)
    to capture process in debugger go to SM37(job overview) or to SM50(process overview)
    Hope this would help you.

  • How To Handle Error Message In TCD Recording?

    Hi All,
      I tried recording a transaction (my own transaction) by not enterring value in an obligatory field. the error message came. but when i executed the script, it showed an error. but actualy, the error message was expected right? how to handle this situation? i tried with tcd and sapgui recording. both gave almot the same result.
      i am including the script which i have written.
    MESSAGE ( MSG_1 ).
    *TCD ( ZCUST , ZCUST_1 , ECC ).
    SAPGUI ( SAP_1 , ECC ).
    ENDMESSAGE ( E_MSG_1 ).
    v_mno = &tfill.
    v_msg = E_MSG_1[v_mno]-msgtext.
    v_mtp = E_MSG_1[v_mno]-msgtyp.
    If Msg Type is E *** **** It Has To Be E ****
    IF ( v_mtp = 'E' and v_msg = 'Account no AC02 does not exist EXIT = X').
    logtext(0,'Passed').
    ELSE.
    log(v_mtp).
    log(v_msg).
    logtext(1,'Failed').
    ENDIF.
    End Of The Condition For Message Type E ******

    I have recording messages using the TCD command.
    My script (very simple):
    MESSAGE ( MSG_2 ).
    TCD ( ME21 , ME21_1 , R3 ).
    ENDMESSAGE ( E_MSG_2 ).
    In the MESSAGE command interface, I defined rules to allow several kind of messages.
    Execution: 3 mesages found:
          * transform PR into PO
           MESSAGE     MSG_2 [1,009 sec]
             RULES  MSG_2 = XML-DATA-01
            Message  MODE  EXIT  TYPE  ID    NR
            [1]      'A'         'I'   06    456
            [2]      'A'         'W'   'ME'  080
            [3]      'A'         'E'   'ZE'  029
             TCD    ME21                 [0,545 sec N] Target sys R3 -> ZDA010A219
            S06017 Standard PO created under the number 8201075606
               Tgt System Z_A219->R3->ZDA010A219 (ZDA 010 ... HP-UX ORACLE)
               CALL TRANSACTION ME21 ME21_1 XML-DATA-01
               03 MESSAGES FROM ME21 ME21_1 XML-DATA-01
               I  06 456 Release effected with release code 00001
               W  ME  080 Delivery date: next workday is 02.05.2007
               S  06 017 Standard PO created under the number 8201075606
           ENDMESSAGE  E_MSG_2 (&TFILL = 0)
    As you can see, 3 messages are found but the &TFILL variable is still 0.
    I guess (but cannot test yet) I would manage to record those messages using SAPGUI command.
    Is there anything wrong with my script?
    My SAP_BASIS component is in version 620. I'm not using the ultimate version of eCATT (no WEBDYNPRO command, etc.). Could it be an explanation?
    Thank you in advance,
    Olivier

  • How to handle error message during PAI?

    Hi Experts,
    Need help here.
    In my dialog screen, I have a field which is typed 'QUAN'.
    In entering different format , e.g. with non numeric value or a negative value, an error message appear and it does not process the MODULES inside the chain or FIELD MODULE ON REQUEST.
    Does anyone knows how to handle this kind of error. I need to display into a separate screen the errors I encountered coz I'm creating a new RF transaction.
    Points will be rewarded.
    Thanks in advance.

    Hai
    in your case(RF case) it is other way...
    yes you can use
    field x_currency module check_currency.
    in module check_currency.
    you have to display errors in another screen say 200.
    in that there will be 4 fields, all are display only fields.
    X_MESSAGE-MSGV1  of type sy-msgv1
    X_MESSAGE-MSGV2  of type sy-msgv2
    X_MESSAGE-MSGV3 of type sy-msgv3
    X_MESSAGE-MSGV4 of type sy-msgv4
    you populate the messages with these fields and then display it in the screen.
      method check_currency.
    *--do all your checks here....
           if error
             clear x_message.
            x_message-msgv1 = 'Enter Valid Employee Number'(004).
            leave to screen 0200.
          endif.
        endif.
    ENDMODULE.                 " VALIDATE_Currency
    in screen 200 PBO you need to format the message
    using the below logic.
           Method for formatting the message
      method message_format.
        data : lt_text type table of tline,         "text table
               lx_text type tline.                  "work area
        refresh lt_text.
        clear lx_text.
        concatenate x_message-msgv1 x_message-msgv2 into lx_text-tdline
          separated by space.
        append lx_text to lt_text.
        clear lx_text.
        concatenate x_message-msgv3 x_message-msgv4 into lx_text-tdline
          separated by space.
        append lx_text to lt_text.
    *- formatting the message
        call function 'FORMAT_TEXTLINES'
          exporting
            formatwidth = 20
          tables
            lines       = lt_text
          exceptions
            bound_error = 1
            others      = 2.
        clear: x_message.
    *- transfer the message data to screen fields
        loop at lt_text into lx_text.
          if sy-tabix = 1.
            x_message-msgv1 = lx_text-tdline.
          elseif sy-tabix = 2.
            x_message-msgv2 = lx_text-tdline.
          elseif sy-tabix = 3.
            x_message-msgv3 = lx_text-tdline.
          elseif sy-tabix = 4.
            x_message-msgv4 = lx_text-tdline.
          else.
            exit.
          endif.
        endloop.
      endmethod.                    "message_format
    Regards
    Vijay

  • How to handle the quotes('') in the procedure?

    Hi all,
    I have been struggling with an issue in the procedure. Let us go to the functionality of the preocedure.
    I am passing a parameter that has text like
    ' INDIA,BANGALORE,"INOX,BLR","THILAK NAGAR,JAYA NAGAR "4TH 'T' BLOCK,BANGALORE",560030'
    Here, INDIA = country field
    BANGALORE = city field
    INOX,BLR = Theatre field
    THILAK NAGAR,JAYA NAGAR "4TH 'T' BLOCK,BANGALORE = address field
    560030 = pin field
    I want to load these fields into the table thru procedure. Here the issue is if any field value come with quotes(") inside the quotes like above address field. Since , please guide me how to handle that quotes while identifying the field value for either or address field or some other one.
    Table structure:
    country varchar2(100 char)
    city varchar2(100 char)
    theatre varchar2(100 char)
    address varchar2(2000 char)
    pin NUMBER
    Procedure Code:
    create or replace
    PROCEDURE prc_rollout_upload( p_text VARCHAR2 )
    AS
    v_quote_ind NUMBER := 0;
    v_first_pos NUMBER := 0;
    v_end_pos NUMBER := 0;
    v_text_data varchar2(32767 CHAR) := p_text;
    v_text_data1 varchar2(32767 CHAR);
    v_text_arr_ind NUMBER := 0;
    v_quote_pos NUMBER := 0;
    v_comma_pos NUMBER := 0;
    type text_rec IS RECORD(country VARCHAR2(20 CHAR),
    CITY VARCHAR2(1000 CHAR),
    exhibitor VARCHAR2(1000 CHAR),
    address VARCHAR2(10000 CHAR),
    PIN varchar2(6)
    type v_text_tab is table of text_rec;
    v_text_array v_text_tab := v_text_tab();
    BEGIN
    -- Fetch the values from the string to a PL/SQL table
    v_text_data1 := v_text_data;
    v_text_arr_ind := v_text_arr_ind + 1;
    v_text_array.extend(v_text_arr_ind);
    -- Country
    IF (INSTR(v_text_data1, CHR(34)) > 0 )
    THEN
    v_quote_ind := INSTR(v_text_data1, CHR(34));
    v_first_pos := INSTR(v_text_data1, CHR(34));
    v_end_pos := INSTR(v_text_data1, CHR(34),1,2);
    v_text_array(v_text_arr_ind).country := SUBSTR(v_text_data1,v_first_pos+1,v_end_pos-2);
    --DBMS_OUTPUT.PUT_LiNE(v_text_array(v_text_arr_ind).country);
    v_text_data1 := SUBSTR(v_text_data1,v_end_pos+2);
    --DBMS_OUTPUT.PUT_LiNE(v_text_data1);
    END IF;
    IF ( v_quote_ind = 0 ) THEN
    v_text_array(v_text_arr_ind).country := SUBSTR(v_text_data1,1,INSTR(v_text_data1,CHR(44))-1);
    --DBMS_OUTPUT.PUT_LiNE(v_text_array(v_text_arr_ind).country);
    v_text_data1 := SUBSTR(v_text_data1,INSTR(v_text_data1,CHR(44))+1);
    -- DBMS_OUTPUT.PUT_LiNE(v_text_data1);
    v_first_pos := 0;
    v_end_pos := 0;
    v_quote_ind := 0;
    END IF;
    -- City
    v_quote_pos := INSTR(v_text_data1,CHR(34));
    v_comma_pos := INSTR(v_text_data1,CHR(44));
    IF ( v_quote_pos < v_comma_pos )
    THEN
    v_quote_ind := INSTR(v_text_data1, CHR(34));
    v_first_pos := INSTR(v_text_data1, CHR(34));
    v_end_pos := INSTR(v_text_data1, CHR(34),1,2);
    v_text_array(v_text_arr_ind).city := SUBSTR(v_text_data1,v_first_pos+1,v_end_pos-2);
    --DBMS_OUTPUT.PUT_LiNE(v_text_array(v_text_arr_ind).city);
    v_text_data1 := SUBSTR(v_text_data1,v_end_pos+2);
    --DBMS_OUTPUT.PUT_LiNE(v_text_data1);
    v_quote_pos := 0;
    v_comma_pos := 0;
    END IF;
    IF ( v_quote_pos > v_comma_pos ) THEN
    v_text_array(v_text_arr_ind).city := SUBSTR(v_text_data1,1,INSTR(v_text_data1,CHR(44))-1);
    -- DBMS_OUTPUT.PUT_LiNE(v_text_array(v_text_arr_ind).city);
    v_text_data1 := SUBSTR(v_text_data1,INSTR(v_text_data1,CHR(44))+1);
    --DBMS_OUTPUT.PUT_LiNE(v_text_data1);
    v_first_pos := 0;
    v_end_pos := 0;
    v_quote_ind := 0;
    v_quote_pos := 0;
    v_comma_pos := 0;
    END IF;
    -- Exhibitor
    v_quote_pos := INSTR(v_text_data1,CHR(34));
    v_comma_pos := INSTR(v_text_data1,CHR(44));
    IF ( v_quote_pos < v_comma_pos )
    THEN
    v_first_pos := INSTR(v_text_data1, CHR(34));
    v_end_pos := INSTR(v_text_data1, CHR(34),1,2);
    v_text_array(v_text_arr_ind).exhibitor := SUBSTR(v_text_data1,v_first_pos+1,v_end_pos-2);
    --DBMS_OUTPUT.PUT_LiNE(v_text_array(v_text_arr_ind).exhibitor);
    v_text_data1 := SUBSTR(v_text_data1,v_end_pos+2);
    --DBMS_OUTPUT.PUT_LiNE(v_text_data1);
    v_quote_pos := 0;
    v_comma_pos := 0;
    END IF;
    IF ( v_quote_pos > v_comma_pos ) THEN
    v_text_array(v_text_arr_ind).exhibitor := SUBSTR(v_text_data1,1,INSTR(v_text_data1,CHR(44))-1);
    --DBMS_OUTPUT.PUT_LiNE(v_text_array(v_text_arr_ind).exhibitor);
    v_text_data1 := SUBSTR(v_text_data1,INSTR(v_text_data1,CHR(44))+1);
    -- DBMS_OUTPUT.PUT_LiNE(v_text_data1);
    v_first_pos := 0;
    v_end_pos := 0;
    v_quote_pos := 0;
    v_comma_pos := 0;
    END IF;
    --Address
    v_quote_pos := INSTR(v_text_data1,CHR(34));
    v_comma_pos := INSTR(v_text_data1,CHR(44));
    IF ( v_quote_pos < v_comma_pos )
    THEN
    v_first_pos := INSTR(v_text_data1, CHR(34));
    v_end_pos := INSTR(v_text_data1, CHR(34),1,2);
    v_text_array(v_text_arr_ind).address := SUBSTR(v_text_data1,v_first_pos+1,v_end_pos-2);
    --DBMS_OUTPUT.PUT_LiNE(v_text_array(v_text_arr_ind).address);
    v_text_data1 := SUBSTR(v_text_data1,v_end_pos+2);
    --DBMS_OUTPUT.PUT_LiNE(v_text_data1);
    v_quote_pos := 0;
    v_comma_pos := 0;
    END IF;
    IF ( v_quote_pos > v_comma_pos ) THEN
    v_text_array(v_text_arr_ind).address := SUBSTR(v_text_data1,1,INSTR(v_text_data1,CHR(44))-1);
    --DBMS_OUTPUT.PUT_LiNE(v_text_array(v_text_arr_ind).address);
    v_text_data1 := SUBSTR(v_text_data1,INSTR(v_text_data1,CHR(44))+1);
    -- DBMS_OUTPUT.PUT_LiNE(v_text_data1);
    v_first_pos :=0;
    v_end_pos := 0;
    v_quote_pos := 0;
    v_comma_pos := 0;
    END IF;
    --PIN
    v_quote_pos := INSTR(v_text_data1,CHR(34));
    v_comma_pos := INSTR(v_text_data1,CHR(44));
    IF ( v_quote_pos < v_comma_pos )
    THEN
    v_first_pos := INSTR(v_text_data1, CHR(34));
    v_end_pos := INSTR(v_text_data1, CHR(34),1,2);
    v_text_array(v_text_arr_ind).pin := SUBSTR(v_text_data1,v_first_pos+1,v_end_pos-2);
    --DBMS_OUTPUT.PUT_LiNE(v_text_array(v_text_arr_ind).pin);
    v_text_data1 := 0;
    --DBMS_OUTPUT.PUT_LiNE(v_text_data1);
    v_quote_pos := 0;
    v_comma_pos := 0;
    END IF;
    IF ( v_comma_pos IS NULL OR v_quote_pos > v_comma_pos ) THEN
    v_text_array(v_text_arr_ind).pin := v_text_data1;
    --DBMS_OUTPUT.PUT_LiNE(v_text_array(v_text_arr_ind).pin);
    v_text_data1 := 0;
    --DBMS_OUTPUT.PUT_LiNE(v_text_data1);
    v_first_pos := 0;
    v_end_pos := 0;
    v_quote_pos := 0;
    v_comma_pos := 0;
    END IF;
    EXCEPTION
    WHEN others then
    DBMS_OUTPUT.PUT_LiNE(SUBSTR(SQLERRM,1,200));
    END prc_rollout_upload;
    Oracle version :
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    Your help would be highly appreciated !!!
    Regards,
    Vissu.....

    To start with Try this:
    SQL> ed
    Wrote file afiedt.buf
      1    declare
      2   v_var VARCHAR2(10000) := 'INDIA,BANGALORE,"INOX,BLR","THILAK NAGAR,JAYA NAGAR ';
      3    v_delim VARCHAR2(1) := ',';
      4    v_enclose VARCHAR2(1) := '"';
      5    v_val VARCHAR2(1000) := NULL;
      6    begin
      7    v_var := v_var||'"4TH T BLOCK,BANGALORE",500365'||',';
      8    FOR I IN 1..5 LOOP
      9    v_val :=  CASE WHEN SUBSTR(v_Var,1,1) <> '"' THEN
    10              SUBSTR(v_Var,1,INSTR(v_Var,',',1,1)-1)
    11              ELSE
    12              SUBSTR(v_Var,2,INSTR(v_Var,'",',1,1) - INSTR(v_Var,'"',1,1) - 1)
    13              END;
    14    v_Var :=  CASE WHEN SUBSTR(v_Var,1,1) <> '"' THEN
    15              SUBSTR(v_Var,INSTR(v_Var,',',1,1) + 1)
    16              ELSE
    17              SUBSTR(v_Var,INSTR(v_Var,'",',1,1) + 2)
    18              END;
    19    dbms_output.put_line(v_Val);
    20    END LOOP;
    21*  end;
    SQL> /
    INDIA
    BANGALORE
    INOX,BLR
    THILAK NAGAR,JAYA NAGAR "4TH T BLOCK,BANGALORE
    500365
    PL/SQL procedure successfully completed.
    SQL>

  • How to handle the plsql error occuring in the exception block

    We know how to handle exceptins which occur in BEGIN block.
    But am unable to catch the exception in the exception block. Am writing an erroeneous code so that the control will go to exception block and there is also one plsql error, but am unable to handle that error, it's returning the error to the calling environment.
    DECLARE
    cnt NUMBER(5):=0;
    BEGIN
    select 'debalina' INTO cnt from dual;
    DBMS_OUTPUT.PUT_LINE(to_char(cnt));
    EXCEPTION
    WHEN invalid_number THEN
    DBMS_OUTPUT.PUT_LINE('error has occured inside begin block');
    cnt:='deba';
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('error has occured inside begin block');
    END;
    please suggest me how to catch this exception?

    Hi,
    DECLARE
    cnt NUMBER(5):=0;
    BEGIN
    select 'debalina' INTO cnt from dual;
    DBMS_OUTPUT.PUT_LINE(to_char(cnt));
    EXCEPTION
    WHEN invalid_number THEN
    DBMS_OUTPUT.PUT_LINE('error has occured inside begin block');
    cnt:='deba';
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('error has occured inside begin block');
    END;
    First of all your namee exception which you have posted i.e invalid_number itself is wrong.
    You need to use named exception VALUE_ERROR for catching the exception in the main block.
    SQL> DECLARE
      2  cnt NUMBER(5):=0;
      3  BEGIN
      4  select 'debalina' INTO cnt from dual;
      5  DBMS_OUTPUT.PUT_LINE(to_char(cnt));
      6  EXCEPTION
      7  WHEN Invalid_number THEN
      8  DBMS_OUTPUT.PUT_LINE('error has occured inside main block');
      9  end;
    10  /
    DECLARE
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    ORA-06512: at line 4
    SQL>  DECLARE
      2   cnt NUMBER(5):=0;
      3  BEGIN
      4  select 'debalina' INTO cnt from dual;
      5  DBMS_OUTPUT.PUT_LINE(to_char(cnt));
      6  EXCEPTION
      7  WHEN VALUE_ERROR THEN
      8  DBMS_OUTPUT.PUT_LINE('error has occured inside main block');
      9  end;
    10  /
    error has occured inside main block
    PL/SQL procedure successfully completed.Your doubt regarding catching the exception in exception block, you can execute as below, by nesting a Begin block inside the exception block itself.
    SQL> DECLARE
      2  cnt NUMBER(35):=0;
      3  BEGIN
      4  select 'debalina' INTO cnt from dual;
      5  DBMS_OUTPUT.PUT_LINE(to_char(cnt));
      6  EXCEPTION
      7  WHEN Value_error THEN
      8  DBMS_OUTPUT.PUT_LINE('error has occured inside main block');
      9  Begin
    10  cnt:='deba';
    11  Exception
    12  WHEN OTHERS THEN
    13  DBMS_OUTPUT.PUT_LINE('error has occured inside exception block');
    14  End;
    15  END;
    16  /
    error has occured inside main block
    error has occured inside exception block
    PL/SQL procedure successfully completed.Hope your doubt is clear.
    Twinkle

Maybe you are looking for

  • Regarding Month End reports

    Hello SAP Experts I got a requests from SAP user that for SAP report (T-Code for report) List of GR IR Balances to be part of the month end processing. Can this report be automatically scheduled as part of month end.

  • Exchange Rate in Profitability Analysis Document

    How is the exchange rate populated in profitability analysis document? We have couple of scenarios: Scenario 1: Credit memo request created without any reference and credit memo is created successfully. Exchange rate populated in the profitability an

  • Roll Name in the Source Window

    Is there a way to automatically show all of my roll names in the source window? I would like to be able to just click on a roll name in the source window and be able to see those particular photos in the main iPhoto window.

  • Upgrading from a 30day trial license to a  Customer license.

    Hi everyone, During the initial install and setup we used the 30-day license, now that all of our processing is complete with SAP and our office, what do we need to fulfill E-commerce WebCrm license. In the license request it ask for SAP owner and ID

  • Oracle Endeca

    HI what is oracle endeca and what is the main usage of oracel endeca? Edited by: 964906 on Nov 18, 2012 10:57 PM