*** Doubt regarding Exception Block ***

Hi,
I have a doubt regarding exception.
My SP has 5-6 select queries that is used in" open <cursor name> for select ...."
also a 'select count(id) into...' statement.
Do I need to have an Exception block inside? I dont have any user defined execptions at all. So will there be any exceptions that gets generated in a select query?
Also 'WHEN OTHERS THEN' is it OK to use where I dont know what all excaptions might occur?
Regds,
S

Hi,
Oracle will raise an error NO_DATA_FOUND , if any of your SELECT statement returns zero records, If you want your process to fail then you can have one common handler (either write to a error_log_table) do all the error_handling.
If you want to continue for some SQL's to move to the next statement then you can do some thing like this.
begin
select statement
when no_data_found then --not an issue, if no data is returned.
NULL;
Refere to this link for more information.
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96624/07_errs.htm#1079
thanks

Similar Messages

  • 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

  • Save all details error in Exception Block of BizTalk

    In orchestration A,I make a Exception Block ,created a System.Exception object and saved Exception Error in a string and checking it in admin console.
    In my orchestarion, I got amount value from a element Amount, used a custom xslt and in that custom xslt, I used a C# function for desired calculation for the value of amount.
    Now when,input string of amount is not in a correct format then a error is saved regarding mapping  as follows:
    Transformation failed for Map A.
    But the actual error is as follows:
    input string was not in a correct format.
    How can I get this error in  exception handler block?
    Prakash

    Hi Prakash,
    Like you have mentioned that you are using Custom XSLT, my advice will be that you can raise an exception from within an XSLT template, based on the value.
    <xsl:message terminate="yes">Custom error text</xsl:message>
    This will cause the XSLT engine to stop processing immediately, and raise an exception.   This exception, including the custom error text contained within the message segment,
    can be caught in the BizTalk Orchestration engine by explicitly catching an exception of type 
    Microsoft.XLANGS.BaseTypes.TransformationFailureException.
    Refer: Biz Talk : How To : Throw Custom Exception in Map
    For step-by-step explanation on this refer: Flowing clear error messages from transforms
    Rachit
    Please mark as answer or vote as helpful if my reply does

  • Have some doubt regarding the  weblog (Lookup's in XI made simpler)

    Hi All,
    I have created the same scenario as mentioned in Siva's weblog (Lookup's in XI made simpler).
    I having some doubts regarding the scenario, it will be great if you help me to resolve the same.
    I am having a file-file scenario where I need to do lookup in database(MS-Access)  through mapping.
    The standard file-file scenario is in place and in addition I have created a receiver jdbc channel . I  have also created the receiver agreement for the same in the cofiguration.
    While creating the receiver agreement you have to specify the interface name which includes the message type…I have specified the normal format which we specify while configuring the jdbc receiver adapter.
    In the message mapping I have created a advance user defined function as mentioned in your weblog which calls my receiver jdbc channel.
    I have also specified the select query to be executed in the mapping program.
    While testing I am getting the following error
    Cannot produce target element /ns0:Role_MT/URole. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd
    <b>Can you please suggest me what all I need to do in addition to the file-file scenario for this lookup scenario to work.</b>
    Thanks and Regards
    Rahul

    Hi,
    Following is my user defined function
    //write your code here
    String Query = "";
    Channel channel = null;
    DataBaseAccessor accessor = null;
    DataBaseResult resultSet = null;
    Query = "Select URole from  Lookup where UName = '  " + UName[0] + "  ' and UPassword = '  " + Pwd[0] +" '  ";
    try{
    channel = LookupService.getChannel("DB_service","JDBC_channel_receiver");
    accessor = LookupService.getDataBaseAccessor(channel);
    resultSet  = accessor.execute(Query);
    for(Iterator rows = resultSet.getRows();rows.hasNext();){
    Map rowMap = (Map)rows.next();
    result.addValue((String)rowMap.get("URole"));
    catch(Exception ex){
    result.addValue(ex.getMessage());
    finally{
    try{
    if (accessor!= null) accessor.close();
    catch(Exception ex){
    result.addValue(ex.getMessage());
    Thanks and Regards
    Rahul

  • Doubt Regarding Statistics Collection in 10g

    Hello,
    Me Jr Dba i have a doubt regarding statistics calculation in 10g.As we know that if we set
    the initilization parameter STATISTICS_LEVEL=Typical then AOS(Automatic Optimizer staistics) calculate the statistics for the tables, whose blocks are greater then 10% changed from the last calculation.Here my doubt is since already statistics are gathered,
    is there any necessity for us to gather the statistics manually by using
    DBMS_STATS.GATHER to see the tables or system statistics.
    Can u plz assist me on the above
    Regards,
    Vamsi

    Hi,
    Please see here,
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/stats.htm#i41448
    If the table/s are changing very frequently than its better to gather the stats manually.This would lead teh volatile table coming up into the stats job again and again.
    For the system stats and data dictionary stats,they are not collected by default.So there is no choice but to gather them manually.
    Aman....

  • Doubt regarding SHDB transaction

    Hi All,   
                I have a doubt regarding the Process Tab in the application tool bar of SHDB transaction. What is the use of the following check boxes?
    1)       Default Size
    2)       Cont.after commit
    3)      not a batch input session
    4)      END: Not a Batch Input session
    5)      Simulate Background mode

    Hi,
    Basically these are the properties for CALL TRANSACTION using. You need not worry about these unless you really need those.
    1) Default Size: it will set the Default screen size for CALL TRANSACTION USING...
    2) Cont.after commit : it will set indicator that CALL TRANSACTION USING... is not completed by COMMIT. after commit also the process will continue
    3) not a batch input session: sets indicator that present session is not batch input
    4) END: Not a Batch Input session
    5) Simulate Background mode : session will be run in foreground. but similar to back grpund
    you can see the documentation by placing the cursor on these and click f1.

  • I was looking at the "Find my iPhone" app and I have a doubt regarding how it works for the macbook. In order to detect the location, the macbook should remain signed into iCloud. What if the thief logs out of iCloud. Would we able to locate the macbook?

    I was looking at the "Find my iPhone" app and I have a doubt regarding how it works for the macbook. In order to detect the location, the macbook should remain signed into iCloud. What if the person who has stolen my macbook logs out of iCloud.
    It should work fine for iPhone/iPad because we can enable "Restrictions" to prevent the user from signing out of iCloud. Do we have simialr settings for the macbook?
    Thanks,

    If it's not on the device list, it indicates that someone has gone to Find My iPhone on icloud.com and manually deleted it from the device list (as explained here: http://help.apple.com/icloud/#mmfc0eeddd), and it has not gone back online since (which would cause it to reappear on the device list; Find My iPhone has been turned of in settings on the device; the iClolud account has been deleted from the device; or the entire devices has been erased and restored.
    Unfortunately, there's no other way to track the phone other than through Find My iPhone.  You could call your carrier and see if they would blackliste it so at least the theif couldn't use it.

  • Very urgent: Doubts regarding CRM WORKFLOW OF BUSINESS PARTNER CREATION

    HI ,
    I HAVE DOUBTS REGARDING CRM WORKFLOW OF BUSINESS PARTNER CREATION, WHILE I AM CREATING BUSINESS PARTNER THROUGH R/3 , IT REFLECT IT INTO MYSAP CRM ALSO, AT THAT TIME IT SENDING THE MAIL TWICE TO THE RECEIPIENT. IS THERE ANY WAY THROUGH  WHICH I CAN RESTRICT IT TO SEND THE MAIL ONLY ONCE,
    PLZ SEND ME THE REPLY AS SOON AS POSSIBLE,
    THANKS  ADVANCED,

    HI
    WORKFLOW SEETING. SAP MAIL
    MULTIPLE MAILS AND
    ONLY ONCE CHOOSE
    ONLY ONCE OPTION ON WHICH VERSION U R WORKING?
    REWARD IF HELPFUL
    VENKAT

  • Doubt regarding  ALE SETTINGS in IDOC scenario.

    Hi Friends,
            I have some doubts regarding ALE settings for IDOC scenarios,  can anyone  please clarify my doubts.
    For exmaple take IDOC to FILE scenario
    The knowledge i got from SDN is --
    One need to do at the  R3 side is  --- RFC DESTINATION (SM59)  for the XI system.
                                                       --- TRFC PORT  for sending IDOC  to the  XI system
                                                       --- CREATING LOGICAL SYSTEM
                                                       --- CREATING PARTNER PROFILE 
                   at the XI side is  --- RFC  Destination ( For SAP sender system)
                                           --- CREATING  PORT  for receiving IDOC from the SAP sending system(IDX1).
    1. Do we create two logical systems for both Sender ( R3 system ) and Receiver( XI system ) in R3 system itself or in XI system or in both systems we create these logical systems? Is this a mandatory step in doing ALE configurations?
    In IDOC to IDOC scenario-------
      2.  Do we craete two RFC destinations in XI system? One RFC DESTINATION for the Sender R3 system and another RFC DESTINATION for the Receiver R3 System? and do we create RFC DESTINATION for the XI system in receiver R3 system? If not.....y we don't create like this........Please give me some clarity on this.............
      3.  If we use IDOC adapter ,since IDOC adapter resides on the ABAP STACK ,we don't need sender communication channel ,for the similar reason----
    y we r creating receiver communication channel in the case of FILE to IDOC scenario?
      4. Can any one please provide me the ALE settings for IDOC to FILE scenario,
                                                                                    FILE to IDOC scenario,                                                                               
    IDOC to IDOC scenario individually.
    Thanks in advance.
    Regards,
    Ramana.

    hi,
    1. Yes, we create two logical systems for both Sender ( R3 system ) and Receiver( XI system ) in R3 system itself and
    it is a mandatory step in doing ALE configurations
    2. We create 1 RFC destination each in R3 and XI.
        R3 RFC destination points to Xi and
        XI RFC destination  points to R3
    3 We need to create Communication Channel for Idoc receiver as the receiver channel is always required but sender may not be necessary
    4. ALE settings for all IDOC scenarios are same  as follows....
    Steps for ALE settings:-
    Steps for XI
    Step 1)
         Goto SM59.
         Create new RFC destination of type 3(Abap connection).
         Give a suitable name and description.
         Give the Ip address of the R3 system.
         Give the system number.
         Give the gateway host name and gateway service (3300 + system number).
         Go to the logon security tab.
         Give the lang, client, username and password.
         Test connection and remote logon.
    Step 2)
         Goto IDX1.
         Create a new port.
         Give the port name.
         Give the client number for the R3 system.
         Select the created Rfc Destination.
    Step 3)
         Goto IDX2
         Create a new Meta data.
         Give the Idoc type.
         Select the created port.
    Steps for R3.
    Step 1)
         Goto SM59.
         Create new RFC destination of type 3(Abap connection).
         Give a suitable name and description.
         Give the Ip address of the XI system.
         Give the system number.
         Give the gateway host name and gateway service (3300 + system number).
         Go to the logon security tab.
         Give the lang, client, username and password.
         Test connection and remote logon.
    Step 2)
         Goto WE21.
         Create a port under transactional RFC.(R3->XI)
         Designate the RFC destination created in prev step.
    Step 3)
         Goto SALE.
         Basic settings->Logical Systems->Define logical system.
         Create two logical systems(one for XI and the other for R3)
         Basic settings->Logical Systems->Assign logical system.
         Assign the R3 logical system to respective client.
    Step 4)
         Goto WE20.
         Partner type LS.
         Create two partner profile(one for XI the other for R3).
         Give the outbound or inbound message type based on the direction.
    Step 5)
         Goto WE19
         Give the basic type and execute.
         fill in the required fields.
         Goto IDOC->edit control records.
         Give the following values.(Receiver port,partner no.,part type and sender Partner no. and type)
         Click outbound processing.
    Step 6)
         Go to SM58
         if there are any messages then there is some error in execution.
         Goto WE02.
         Check the status of the IDOC.
         Goto WE47.
         TO decode the status code.
    Step 7)
         Not mandatory.
         Goto BD64.
         Click on Create model view.
         Add message type.
    BD87 to check the status of IDOC.
    In case if not authorized then go to the target system and check in SU53, see for the missing object
    and assign it to the user.
    SAP r3
    sm59(status check)(no message)
    WE02(status check)
    WE05(status check)
    BD87(status check)
    Xi
    IDx5(Idoc check)
    SU53(authorization check)
    Reward points if helpful
    Prashant

  • Informix 7.3 - Oracle 8i migration: Generate Exception Blocks not offered

    I have installed OMWB 2.0.2 and plugin for Infromix Dynamic Server 7.3.
    There is no offered checkbox "Generate Exception Blocks" in "Parse Options" panel for customization of parsing stored procedures in Source Model.
    (But it was normally offered and working in previous OMWB 1.4.1 wersion).
    How I could coerce OMWB2.0.2 to generate BEGIN-EXCEPTION-END blocks around every SELECT statement in stored procedures ?
    Many thanks
    Vladimir Kubanka (alias Bare Foot)
    [email protected] , [email protected]

    Vladimir,
    Generate Exception Blocks parse option is available on the T/SQL to PL/SQL parsers (Sybase and Microsoft SQLServer), I suppose you could put in an enhancement request if this functionality was important to yourself and other users.
    Turloch

  • Capturing error in Exceptions Block in a PLSQL Procedure

    Hi,
    I am creating a procedure where i need to update a table with some constraints.
    i need to update atleast a million records with data from another table.
    but here is the catch while updating million records, there may be some records which wont be vaild because of the constraints and cannot be updated and hence will give an error.
    but in my procedure i want to write an exception block where it captures the error, ignores the error and keep coninuing the procedure and update all the remaining records instaed of getting hanged at the point of erorr.
    How can i do this.
    I know i can disable the constraints in the table.
    but i want the constraints enabled, so that the errors are trapped and skipped and only the records that are valid are updated.
    Can seomone help me write this exception block which does this function.
    Thanks,
    Philip.

    Hi,
    I used the exception bloack as u said.
    i have a sample of 20 records and i know the 11th record is not valid and should be inserted in a different way from the rest 19 records.
    so i ran the same query with the exceptions block.
    but what happened, until 10th record everything was fine.
    on the 11th record the execution went into the exceptions block and executed whatever was there in the exception block, but then the script just exited after exception block, it did not go back to fetch the remaining records from 12th unitl 20th.
    How can i fix this.
    Philip.

  • DBMS_OUTPUT in exception block

    Hi:
    I have a user defined exception and I am trying to use DBMS_OUTPUT.PUT_LINE in the exception block. Even though I run the code in sqlplus with serverputput on, the dbms_output is not displayed. Why?
    Here is an example:
    DECLARE
    salary_too_high EXCEPTION;
    current_salary NUMBER := 20000;
    max_salary NUMBER := 10000;
    erroneous_salary NUMBER;
    BEGIN
    BEGIN ---------- sub-block begins
    IF current_salary > max_salary THEN
    RAISE salary_too_high; -- raise the exception
    END IF;
    EXCEPTION
    WHEN salary_too_high THEN
    -- first step in handling the error
    DBMS_OUTPUT.PUT_LINE('Salary ' || erroneous_salary || ' is out of range.');
    DBMS_OUTPUT.PUT_LINE('Maximum salary is ' || max_salary || '.');
    END;
    Please help.
    Thanks.
    Bruce

    Is this the complete code you have, or this is just part of the whole code?
    I tried to run it, and it's perfectly OK.
    SQL> set serverout on size 100000
    SQL> DECLARE
      2  salary_too_high EXCEPTION;
      3  current_salary NUMBER := 20000;
      4  max_salary NUMBER := 10000;
      5  erroneous_salary NUMBER;
      5  BEGIN
      6     begin
      7   
      8    if current_salary > max_salary then
      9      RAISE salary_too_high; -- raise the exception
    10    END IF;
    11    EXCEPTION
    12    WHEN salary_too_high THEN
    13    -- first step in handling the error
    14    DBMS_OUTPUT.PUT_LINE('Salary ' || erroneous_salary || ' is out of range.');
    15 dbms_output.put_line('Maximum salary is ' || max_salary || '.');
    16 end;
    17 end;
      18 /
    Salary  is out of range.
    Maximum salary is 10000.
    PL/SQL procedure successfully completed.

  • Ref cursor in exception block

    Hi all.. I have a stored procedure that needs to return a records to Crystal Report.
    I'm using an outpur parameter of type cursor.
    In the proc, I am selecting the data from a table based on the input criteria and inserting into a GTT table,
    if so, retrieve and store in the table and generate and throw output to CR.
    if it is not returning any data i should raise exception and throw the related message to CR.
    But in my proc even though it wont insert data into table b going inot next statements where it should not go.
    create or replace procedure a(a1 varchar2,ref_cur out pkg1.cru)
    as
    cnt number;
    begin
    insert into b
    (select * from a where a.col=a1);
    commit;
    open ref_cur for
    select a.col from a;
    EXCEPTION
    WHEN OTHERS THEN
    RAISE_APPLICATION_ERROR (-20001, SQLERRM);
    WHEN NO_DATA_FOUND THEN
         open ref_cur for
    select 'No Data Found' col from dual;
    end;
    1.please suggest wherer to raise exception when "select * from a where a.col=a1" doesn't return any value.
    2. Can ref cursor be used in exception block.
    if i use condition like
    after the insert statement
    select count(*) into cnt from b;
    if cnt=0 then
    raise NO_DATA_FOUND;
    EXCEPTION
    WHEN OTHERS THEN
    RAISE_APPLICATION_ERROR (-20001, SQLERRM);
    WHEN NO_DATA_FOUND THEN
         open ref_cur for
    select 'No Data Found' col from dual;
    please suggest any other way to handle
    Thanks in advance

    First and foremost some fundamental things:
    EXCEPTION
    WHEN OTHERS THEN
    RAISE_APPLICATION_ERROR (-20001, SQLERRM);
    WHEN NO_DATA_FOUND THEN
    open ref_cur for
    select 'No Data Found' col from dual;
    end;1. You can not declare WHEN OTHERS before any other EXCEPTION. You can not compile this. Here you have declared WHEN OTHERS first then NO_DATA_FOUND and it is erroneous.
    2. This is not the way you want to handle the WHEN OTHERS exception.
    WHEN OTHERS_
    http://tkyte.blogspot.com/2008/06/when-others-then-null-redux.html
    http://tkyte.blogspot.com/2007/03/dreaded-others-then-null-strikes-again.html
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e17126/toc.htm

  • DBMS_XMLGEN --Number of active cursors in increased in Exception block

    Hi ,
    We have a custom code that use DBMS_XMLGEN,the issue is when any exception happens the Number os active cusrors increse and when it happens in a lopp we hit 1000ORA-01000: maximum open cursors exceeded.
    Although I close the context in the exception Block.
    Below is sample code where I could replicate this:
    Step1.Create a table
    CREATE TABLE EMP(EMP_NO NUMBER,EMPNAME VARCHAR2(100));
    Step2:
    Create  a Procedure:
    CREATE OR REPLACE PROCEDURE TEST_XMLGEN
    AS
    l_clob CLOB;
      l_ctx         dbms_xmlgen.ctxhandle;
      p_sql VARCHAR2(4000):='SELECT EMP_NO,,EMPNAME FROM EMP';--syntax error on purpose ,so that exception happens
      l_cursor_count NUMBER;
    BEGIN
    SELECT VALUE
               INTO l_cursor_count
               FROM v$mystat a, v$statname b
              WHERE     a.statistic# = b.statistic#
                    AND b.name = 'opened cursors current';
            DBMS_OUTPUT.PUT_LINE ('open cursors place00' || l_cursor_count);
    l_ctx := dbms_xmlgen.newcontext (p_sql);
    SELECT VALUE
               INTO l_cursor_count
               FROM v$mystat a, v$statname b
              WHERE     a.statistic# = b.statistic#
                    AND b.name = 'opened cursors current';
             DBMS_OUTPUT.PUT_LINE('open cursors place01' || l_cursor_count);
    dbms_xmlgen.getxml (l_ctx,l_clob);
    SELECT VALUE
               INTO l_cursor_count
               FROM v$mystat a, v$statname b
              WHERE     a.statistic# = b.statistic#
                    AND b.name = 'opened cursors current';
             DBMS_OUTPUT.PUT_LINE ('open cursors place02' || l_cursor_count);
    DBMS_OUTPUT.PUT_LINE('l_clob:'||l_clob);
    dbms_xmlgen.closecontext (l_ctx);
    SELECT VALUE
               INTO l_cursor_count
               FROM v$mystat a, v$statname b
              WHERE     a.statistic# = b.statistic#
                    AND b.name = 'opened cursors current';
             DBMS_OUTPUT.PUT_LINE ('open cursors place03' || l_cursor_count);
    EXCEPTION
    WHEN OTHERS
    THEN
    SELECT VALUE
               INTO l_cursor_count
               FROM v$mystat a, v$statname b
              WHERE     a.statistic# = b.statistic#
                    AND b.name = 'opened cursors current';
             DBMS_OUTPUT.PUT_LINE ('open cursors place04' || l_cursor_count);
    dbms_xmlgen.closecontext (l_ctx);
    SELECT VALUE
               INTO l_cursor_count
               FROM v$mystat a, v$statname b
              WHERE     a.statistic# = b.statistic#
                    AND b.name = 'opened cursors current';
             DBMS_OUTPUT.PUT_LINE ('open cursors place05' || l_cursor_count);
    END;
    Step3: Execute above Procedure
    If you look at the number of active cursor it is increased in exception block,I suspect this is what is causing issue with my program too.Any suggestions to solve this issue.
    Thanks
    Shefali

    Did you mean this test:
    declare
      ts timestamp;
      type tp_strings is table of varchar2(32767) index by pls_integer;
      t_strings tp_strings;
      t_tmp xmltype;
      t_nd dbms_xmldom.domnode;
      t_nl dbms_xmldom.domnodelist;
      t_clob clob;
    begin
      t_clob := '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'
             || '<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="5000" uniqueCount="5000">';
      for i in 1 .. 5000
      loop
        t_clob := t_clob || to_clob( '<si><t>A' || to_char( i ) || '</t></si>' );
      end loop;
      t_clob := t_clob || '</sst>';
      t_tmp := xmltype( t_clob );
      t_strings.delete;
      ts := systimestamp;
          select str
          bulk collect into t_strings
          from xmltable( xmlnamespaces( default 'http://schemas.openxmlformats.org/spreadsheetml/2006/main' )
                       , '/sst/si' passing t_tmp
                       columns str clob path 't'
      dbms_output.put_line( systimestamp - ts );
      dbms_output.put_line( t_strings.count() || ' ' || t_strings( t_strings.first )  || ' ' || t_strings( t_strings.last ) );
      t_strings.delete;
      ts := systimestamp;
          select /*+ NO_XML_QUERY_REWRITE */ str
          bulk collect into t_strings
          from xmltable( xmlnamespaces( default 'http://schemas.openxmlformats.org/spreadsheetml/2006/main' )
                       , '/sst/si' passing t_tmp
                       columns str clob path 't'
      dbms_output.put_line( systimestamp - ts );
      dbms_output.put_line( t_strings.count() || ' ' || t_strings( t_strings.first )  || ' ' || t_strings( t_strings.last ) );
      t_strings.delete;
      ts := systimestamp;
          t_nd := dbms_xmldom.makenode( dbms_xmldom.getdocumentelement( dbms_xmldom.newdomdocument( t_tmp ) ) );
          t_nl := dbms_xslprocessor.selectnodes( t_nd, '/sst/si/t/text()', 'xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"' );
          for i in 0 .. dbms_xmldom.getlength( t_nl ) - 1
          loop
            t_strings( i ) := dbms_xmldom.getnodevalue( dbms_xmldom.item( t_nl, i ) );
          end loop;
      dbms_output.put_line( systimestamp - ts );
      dbms_output.put_line( t_strings.count() || ' ' || t_strings( t_strings.first )  || ' ' || t_strings( t_strings.last ) );
    end;  

  • RAISE_APPLICATION_ERROR works only in exception block

    Hi,
    I am facing a strange issue. My RAISE_APPLICATION_ERROR wroks only in EXCEPTION block and not in BEGIN block. Please have a look at below description
    I have a procedure that has IF Block as shown below.
    BEGIN
    IF TO_DATE('31-DEC-99', 'DD-MON-RR') > TO_DATE('11-MAR-12', 'DD-MON-RR') THEN
    RAISE_APPLICATION_ERROR(-20001, 'some message');
    END IF;
    END;
    -- RAISE_APPLICATION_ERROR is not working in the above code.
    BEGIN
    IF TO_DATE('31-DEC-99', 'DD-MON-RR') > TO_DATE('11-MAR-12', 'DD-MON-RR') THEN
    RAISE EX_ABC
    END IF;
    EXCEPTION
    WHEN EX_ABC THEN
    RAISE_APPLICATION_ERROR(-20001, 'some message');
    END;
    --Here the exception is raised and it works fine.
    BACKDROP:
    I have made a trigger that does date validations. It calls procedure for all the validations. And the above shown code is a part of the validations that the procedure does.
    Please help.
    Edited by: Ishan on Mar 14, 2012 1:28 PM
    Edited by: Ishan on Mar 14, 2012 1:31 PM

    Ishan wrote:
    I have myself checked and tested with all these conditions. Tried all to_date formats and dbms_output to be sure of the values but nothing seems to work.
    It works in a sample code. But when implemented in the procedure it is ignoring the RAISE_APPLICATION_ERROR.
    Condition is correct. Below is the logic because of which I can say it's correct
    If 1=1 then
    raise_application_error (-20001, 'ABC');
    end;
    this ignores the raise_application_error.
    However if I modify the code with exception block, WITHOUT CHANGING THE CONDITION, iti works fine
    if 1=1 then
    raise ex_ab
    exception
    raise_application_error (-20001, 'ABC');
    end;
    Now the exception is raised.
    NOTE: EVen if I am using 1=1 condition in my code, it is still ignoring the RAISE_APPLICATION error but it will raise the same in he exception block.
    Not sure how is this possible.Are you saying the below code is giveing different result in your db?
    BEGIN
    IF 1=1 THEN
    RAISE_APPLICATION_ERROR(-20001, 'some message');
    END IF;
    END;

Maybe you are looking for

  • X230T: Slow scroll after swipe on Windows 8

    Hi! I have an X230T running Windows 8 and working quite well with it. I face a Problem with using Windows 8, the scroll speed after swiping (f. e. in Internet Explorer or start menu) is pretty slow. For example: you have loaded a web page in IE 10 wh

  • Problem with loading a few sides example one

    i have got problem with lsome side http://forum.arch-linux.pl/ 504 Gateway Time-out nginx/0.6.35 what is wrong? Last edited by firmajp (2009-10-04 22:03:02)

  • Unstructured Templates

    Can templates process values from the report? I am trying to insert column values into the heading of a report using a template. The custom report layout won't recognize column values in the heading.

  • PS: ORIGINAL BUDGET

    Please I need to know about tables associated with  the original budget date for PROJECT SYSTEM. Thanks for your help. Best regards

  • Distribution Run

    Hi, I am executing FAGLGA35, the system showing the following message. ystem error in the FI interface Message no. F5869 Diagnosis A document header without items was found in the FI interface. System response Inconsitent FI documents are not posted.