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.

Similar Messages

  • 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

  • Trap error in decleration block..?

    in below code I know at line no 2 there is error of pricision length is too large.
    but i want to trap this error in exception or meant to say I want to display error message "number precision too large" while running this codelike other exception in code.what is the possible way to trap this error in exception block.i wrote if block to trap it but its not working..
    DECLARE
    X NUMBER(2):=111;
    Y NUMBER;
    PCEXP EXCEPTION;
    BEGIN
    IF LENGTH(X)>2 THEN
    RAISE PCEXP;
    END IF;
    SELECT SUM(SAL) INTO Y FROM EMP;
    EXCEPTION
    WHEN PCEXP THEN
    DBMS_OUTPUT.PUT_LINE('PCEXP CAUGHT..');
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('OTHERS CAUGHT');
    END;

    Hi,
    welcome in the Installation forum. I think you should post your question in the PL/SQL forum. Here the link:
    PL/SQL
    Cheers,
    David
    OCP 9i / 10g / 11g
    http://www.oratoolkit.ch/knowledge/howto/installation/otn.php

  • Errors or exception in j_security_check?

    Can I capture any error or exception in a error page with the j_security_check?
    For example, when the login, the pass or the role are failed.
    Thanks!!

    Yes you can capture error or exception with j_security_check by defining
    <form-error-page>/MyErrorPage.jsp</form-error-page>
    but not clear with what you mean to ask in example.

  • 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

  • CcBPM, how to capture error message in the exception branch ?

    Hi,
    Can I capture error message in the exception branch ? how to do that ?
    because i want to raise the alert including with the error message ?
    Cheers
    Fernand

    Hello Fernand,
    I hope at the end of this you may get some knowledge on Alerts.
    /people/michal.krawczyk2/blog/2005/09/09/xi-alerts--step-by-step XI:Alerts step-by-step. (fundamental Basic)
    /people/sap.user72/blog/2005/11/24/xi-configuring-ccms-monitoring-for-xi-part-i CCMS Monitoring for XI. (CCMS monitoring for XI is enough later
    we configure to Adapter Engine).
    /people/aravindh.prasanna/blog/2005/12/23/configuring-scenario-specific-e-mail-alerts-in-xi-ccms-part--1 Configuring scenario specific E-mail alerts in XI-CCMS: Part-1
    (This is Important)
    /people/aravindh.prasanna/blog/2005/12/24/configuring-scenario-specific-e-mail-alerts-in-xi-ccms-part-2 Configuring scenario specific E-mail alerts in XI-CCMS: Part-2
    /people/aravindh.prasanna/blog/2006/02/20/configuring-scenario-specific-e-mail-alerts-in-xi-ccms-part-3 Configuring scenario specific E-mail alerts in XI-CCMS: Part 3
    /people/federico.babelis2/blog/2006/05/03/solution-manager-cen-and-alerting-configuration-guide-for-dummies Solution Manager CEN and Alerting configuration (Advanced)
    Please reward points if it is useful...
    Thanks,
    Satya Kumar

  • Using Execute Immediate in PLSQL block Vs Stand alone procedure

    I am facing very unusual ( atleast unusual to me ) with usage of "Execute Immediate" statement.
    I have a table dynamic_sql with one column plsql_block as VARCHAR2(4000);
    I have stored some PLSQL blocks ('DECLARE ..... BEGIN.... END.... ) in this column .
    Now I want to execute these PLSQL blocks one after other depending on certain conditions .
    In order to archive this I wrote a PLSQL block as below
    DECLARE
    Cursor c1 is
    select plsql_block from dynamic_sql
    begin
    for irec in c1
    loop
    <<< Condition >>>
    begin
    execute_immediate(irec.plsql_block);
    exception
    when others then
    raise_application_error(-20001,'error ' ||irec.plsql_block||' '||sqlerrm);
    end loop ;
    end ;
    With above PLSQL block , "execute immediate" is executing PLSQL block successfully without any error
    But When I converted above PLSQL block into standalone procedure as shown below , I am getting error .
    CREATE OR REPLACE procedure test AS
    Cursor c1 is
    select plsql_block from dynamic_sql
    begin
    for irec in c1
    loop
    <<< Condition >>>
    begin
    execute_immediate(irec.plsql_block);
    exception
    when others then
    raise_application_error(-20001,'error ' ||irec.plsql_block||' '||sqlerrm);
    end loop ;
    end ;
    BEGIN
    test;
    end ;
    It is showing the value of irec.plsql_block but not showing sqlerrm...
    I found this is very unusual as I am able to execute "execute immediate" statement with PLSQL block but not with similar procedure .
    can anybody explain me why this is happening?
    Thanks in Advance
    Amit

    Hello,
    It doesn't make any sense to add SQLERRM for user defined exception, unless you want to raise application error for already defined error (e.g NOT_DATA_FOUND, ..)
    Check following piece of code and its output,
    CREATE OR REPLACE PROCEDURE myinsert1
    AS
       v_count   NUMBER;
       v_sql     VARCHAR2 (300);
    BEGIN
       v_sql :=
          'INSERT INTO ENTITY_EMPLOYEE VALUES(0,''TIM'',''LASTNAME'',10000)';
       BEGIN
          EXECUTE IMMEDIATE v_sql;
          COMMIT;
       EXCEPTION
          WHEN OTHERS
          THEN
             DBMS_OUTPUT.PUT_LINE (SUBSTR (SQLERRM, 1, 300));
             RAISE_APPLICATION_ERROR (-20002, 'My Error ' || SQLERRM, TRUE);
             RAISE;
       END;
    END;
    Output._
    ORA-20002: My Error ORA-00001: unique constraint (ENTITY_EMPLOYEE_PK) violated
    ORA-06512: at "MYINSERT1", line 21
    ORA-00001: unique constraint (ENTITY_EMPLOYEE_PK) violated
    ORA-06512: at line 2
    Regrds

  • WEBCENTER CAPTURE - ERROR DURING CHECK-IN

    Hi,
    I’ve configured my commit driver as a “WebCenter Content”.
    When releasing a batch I can see from the log that CHECKIN_UNIVERSAL is invoked but fails later with an exception -
    “[APP: capture] Unable to locate authentication handler for Content Server response: OK
    [2013-10-14T11:25:53.636+02:00] [capture_server1] [ERROR] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture] Error sending check-in request.[[ “
    Anybody encountered such a behavior?
    Thanks, Yan
    The log:
    [2013-10-14T11:23:33.214+02:00] [capture_server1] [NOTIFICATION] [] [oracle.odc.batchprocessor.BatchProcessorBean] [tid: [ACTIVE].ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-0000000000000087,0] [APP: capture]  [SCND_DOC26 (26)] No batch processor specified, batch will be unlocked and placed in a ready state.
    [2013-10-14T11:25:40.417+02:00] [capture_server1] [NOTIFICATION] [] [oracle.oddc.servlet.FileExchange] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: weblogic] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a4,0] [APP: capture] [DSID: 0000K6qH3ZnDwW05zzWByW1IMvRE000001] Starting upload
    [2013-10-14T11:25:40.573+02:00] [capture_server1] [NOTIFICATION] [] [oracle.oddc.servlet.FileExchange] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: weblogic] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a4,0] [APP: capture] [DSID: 0000K6qH3ZnDwW05zzWByW1IMvRE000001] Upload complete in 516
    [2013-10-14T11:25:40.652+02:00] [capture_server1] [NOTIFICATION] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture]  [SCND_DOC27 (27)] Initializing RIDC.
    [2013-10-14T11:25:40.652+02:00] [capture_server1] [NOTIFICATION] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture] [SCND_DOC27 (27)] Loading Capture metadata definitions from workspace ID 1.
    [2013-10-14T11:25:52.870+02:00] [capture_server1] [NOTIFICATION] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture]  [SCND_DOC27 (27)] Creating RIDC binder for check-in.
    [2013-10-14T11:25:52.870+02:00] [capture_server1] [NOTIFICATION] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture]  [SCND_DOC27 (27)] binder.putLocal("IdcService", "CHECKIN_UNIVERSAL")
    [2013-10-14T11:25:52.870+02:00] [capture_server1] [NOTIFICATION] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture]  [SCND_DOC27 (27)] binder.putLocal("dDocTitle", "redinvoice")
    [2013-10-14T11:25:52.870+02:00] [capture_server1] [NOTIFICATION] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture]  [SCND_DOC27 (27)] binder.putLocal("dDocType", "Binary")
    [2013-10-14T11:25:52.870+02:00] [capture_server1] [NOTIFICATION] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture]  [SCND_DOC27 (27)] binder.putLocal("dSecurityGroup", "Public")
    [2013-10-14T11:25:52.870+02:00] [capture_server1] [NOTIFICATION] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture]  [SCND_DOC27 (27)] binder.putLocal("dDocAccount", "")
    [2013-10-14T11:25:52.870+02:00] [capture_server1] [NOTIFICATION] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture]  [SCND_DOC27 (27)] Adding metadata to binder. Name: [xComments]. Value: [red].
    [2013-10-14T11:25:52.870+02:00] [capture_server1] [NOTIFICATION] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture]  [SCND_DOC27 (27)] binder.putLocal("dDocAuthor", "weblogic")
    [2013-10-14T11:25:52.870+02:00] [capture_server1] [NOTIFICATION] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture]  [SCND_DOC27 (27)] primaryFile: C:\Users\ADMINI~1\AppData\Local\Temp\27\redinvoiceYan.PDF
    [2013-10-14T11:25:52.870+02:00] [capture_server1] [NOTIFICATION] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture]  [SCND_DOC27 (27)] Sending check-in request.
    [2013-10-14T11:25:53.480+02:00] [capture_server1] [WARNING] [] [] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture] Unable to locate authentication handler for Content Server response: OK
    [2013-10-14T11:25:53.636+02:00] [capture_server1] [ERROR] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture] Error sending check-in request.[[
    oracle.stellent.ridc.protocol.http.HttpProtocolException: Http status: Moved Temporarily
    at oracle.stellent.ridc.protocol.http.IdcHttpProtocol.writeRequest(IdcHttpProtocol.java:271)
    at oracle.stellent.ridc.IdcClient.sendRequest(IdcClient.java:181)
    at oracle.odc.commit.cs.ContentCommitDriver.releaseDocument(ContentCommitDriver.java:479)
    at oracle.odc.commitprocessor.CommitProcessor.processBatch(CommitProcessor.java:407)
    at oracle.odc.batchprocessor.BatchProcessorBean.processMessage(BatchProcessorBean.java:135)
    at oracle.odc.batchprocessor.CommitProcessorBean.onMessage(CommitProcessorBean.java:59)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    at com.oracle.pitchfork.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:103)
    at oracle.security.jps.ee.ejb.JpsAbsInterceptor$1.run(JpsAbsInterceptor.java:113)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:324)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)
    at oracle.security.jps.ee.ejb.JpsAbsInterceptor.runJaasMode(JpsAbsInterceptor.java:100)
    at oracle.security.jps.ee.ejb.JpsAbsInterceptor.intercept(JpsAbsInterceptor.java:154)
    at oracle.security.jps.ee.ejb.JpsInterceptor.intercept(JpsInterceptor.java:113)
    at sun.reflect.GeneratedMethodAccessor230.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
    at com.oracle.pitchfork.intercept.JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:68)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at com.sun.proxy.$Proxy235.onMessage(Unknown Source)
    at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:583)
    at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:486)
    at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:389)
    at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4659)
    at weblogic.jms.client.JMSSession.execute(JMSSession.java:4345)
    at weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3822)
    at weblogic.jms.client.JMSSession.access$000(JMSSession.java:115)
    at weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:5170)
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

    The only thing I can think of is to check the Capture side - see Monitoring Capture - 11g Release 1 (11.1.1) (and the following chapter). Try to find what's being logged. Focus namely on Commit Batches (4.4.4.)
    I'm afraid that either way (user will be in Capture, but not in UCM, or user won't be in either Capture, or UCM) you will need to search if something like that was not reported.

  • 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.

  • 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;

  • Why is User defined exception block not reaching

    I want to catch exception if wrong column name is there in a select statement.
    In this example i am useing static query but in real time it will be a dynamic query and it may be possible that a particualre column has been deleted from that table so an error will be returned that we need to catch and display custom message to the user. But control is not going to exception block.
    type_id1 column is not there in table1
    what is that i am missing here?
    declare
    vcTypeID varchar2(10);
    invalid_COLUMNs EXCEPTION;
    pragma exception_init(invalid_COLUMNs,-06550);
    begin
    select to_char(type_id1) into vcTypeID from table1 WHERE ROWNUM=1;
    dbms_output.put_line(vcTypeID);
    exception
    when invalid_COLUMNs then
    dbms_output.put_line('def');
    when others then
    dbms_output.put_line('others');
    end;
    Edited by: user13065317 on Jun 1, 2012 12:47 AM

    Hi,
    Why are you trying to catch 6550? I'd rather try with 904 - invalid identifier
      1  DECLARE
      2  e EXCEPTION;
      3  PRAGMA EXCEPTION_INIT(e, -904);
      4  v VARCHAR2(128);
      5  BEGIN
      6   EXECUTE IMMEDIATE 'SELECT TO_CHAR(nonexisting) FROM dual' INTO v;
      7  EXCEPTION
      8   WHEN e THEN dbms_output.put_line('Invalid identifier');
      9* END;
    SQL> /
    Invalid identifier
    PL/SQL procedure successfully completed.
    SQL>Lukasz

  • User defined error handling in PLSQL procedure of portal form

    I need some help of building a user defined exception handling in PLSQL.
    I build a portal form based on a PLSQL procedure.
    In this procedure there are several SQL statements with exception handling.
    In case of exception I want to display my on error message and than raise the procedure, so that the user can read the message and than go back to form.
    I try this by calling a raise statement generating some HTML output over htp.p() but than the output look's like
    SQL:
    begin
    "ACHEMA2003"."P_LOGIN" ( P_STAMM_SEQ => 33491, P_ADRESSNR => 2009721, P_PASSWORD => '3333', P_PROJEKT_ID => 'ACHEMA2003', P_MESSENR => '00023', P_SPKZ => 'D');
    end;
    ORA-20000:
    Login ACHEMA 2003
    Ung|ltiges Passwort !!!
    Back to form
    I want to supress the standard Oracle messages.
    Now I read about the packages wwerr_api_error and wwerr_api_error_ui to make this, but it seems to be a little difficult.
    Is there anybody who have a solution for this problem, perhaps some example PLSQL code for this.
    Thanks Erwin.

    Jacob,
    Try following:
    declare
    v_sender VARCHAR2(1000);
    v_sender_id NUMBER;
    begin
    v_sender := p_session.get_value_as_VARCHAR2(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'A_SENDER');
    v_sender_id := p_session.get_value_as_NUMBER(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'A_SENDER_ID');
    insert into hd (number, text) values (hd_seq.nextval,
    'step 3 v_sender = ' || v_sender ||
    ' v_sender_id = ' || v_sender_id);
    if v_sender_id >= 100 then
    p_session.set_value(
    p_block_name => "_block",
    p_attribute_name => '_STATUS',
    p_value => 'Sender ID must be less than 100!');
    -- return to your form with status message set
    -- and all fields filled with recent values
    return;
    end if;
    end;
    -- This point is reached only if validation is OK
    doInsert;
    Regards,
    Henn

  • Dynamic Pages Error Took exception (WWV-01801)

    I have a dynamic page which I can save (and it runs fine). When I try to edit it, I get the error:
    Took exception (WWV-01801)
    This isn't very descriptive. Where can I start looking?

    It appears to be a bug in Portal.
    If I shrink down the size of my PL/SQL segment in the dynamic page, all is fine.
    This ultimately limits the size of PL/SQL blocks in a dynamic page. It would be nice if Portal should warn you about this.

  • How to capture errors when a Function module is called as BACKGROUND TASK

    How to capture errors when a Function module is called as BACKGROUND TASK?.Please advise.
    FUNCTION ZRPM_DELETE_PROJECT_DATA_API.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(IV_EXTERNAL_ID) TYPE  RPM_TV_EXTID OPTIONAL
    *"     VALUE(IV_PROJECT_GUID) TYPE  RPM_TV_GUID OPTIONAL
    *"     VALUE(FLAG) TYPE  BOOLEAN OPTIONAL
    *"  EXPORTING
    *"     VALUE(EV_RC) TYPE  I
    *"     VALUE(EV_MSG) TYPE  STRING
    *"     VALUE(ET_MSG) TYPE  RPM_TT_MESSAGES
      IF flag = cl_rpm_co=>sc_true.
        Call function 'RPM_DELETE_PROJECT_DATA' IN BACKGROUND TASK
          EXPORTING
            IV_EXTERNAL_ID  = IV_EXTERNAL_ID
            IV_PROJECT_GUID = IV_PROJECT_GUID
          IMPORTING
            EV_RC           = EV_RC
            EV_MSG          = EV_RC
            ET_MSG          = ET_MSG.
        COMMIT WORK.
      ELSE.
        CALL FUNCTION 'RPM_DELETE_PROJECT_DATA'
          EXPORTING
            IV_EXTERNAL_ID  = IV_EXTERNAL_ID
            IV_PROJECT_GUID = IV_PROJECT_GUID
          IMPORTING
            EV_RC           = EV_RC
            EV_MSG          = EV_MSG
            ET_MSG          = ET_MSG.
      ENDIF.
    ENDFUNCTION.
    In above code how to capture 'EV_RC' when FM is called as background task.

    Prakash,
    CALL FUNCTION IN BACKGROUND TASK allows no IMPORTING parameters, so that your code will produce a syntax error.
    The calling program can only handle errors of remote function calls (RFC) if these are either
    - synchronous RFC  (that is CALL FUNCTION ... DESTINATION ...) or
    - asynchronous RFC (that is CALL FUNCTION STARTING NEW TASK ... DESTINATION ...).
    Both synchronous and asynchronous RFC allow the capturing of errors by means of exceptions. But that is a different topic.

Maybe you are looking for

  • Error during import/export Software Component in IR

    After updating XI(DEV) to following SP19 stacks, the problem was encountered with the export or import of design objects in integration repository. All following were completed successfully, 1. SAP KERNEL 6.40, to latest patch level 155; 2. SAP BASIS

  • Current iTunes MSVCR80.dll, Error 7 (windows error 126): SOLVED.

    Dear avid iTunes users - I have cracked it!!! The response from Apple/iTunes was extremely poor and did not solve the problem. I have a look in msconfig and observed which applications/services were running - one of which was the 'Apple Application S

  • Edit rich text in apex

    Hi, I was using rich text field in my form in apex database application. After submit, the context in rich text field will be saved in database clob column. I experienced some difficulties to edit the info in the rich text area. For example, I could

  • How to recover songs that were deleted

    How do I recover songs that were deleted from itunes library and itunes acount and coputuer.

  • Error when trying to compile HTML help

    I'm using RoboHelp 7.0 on Windows XP. All of the sudden, last week, I start getting the following error when I try to compile "Fatal Error: Unexpected error from Microsoft HTML compiler." I've read the other posts regarding this error and deleted the