SQLException exception handling

Is it possible to retrieve the name of name of column for which exception SQL occurred?

For example a table MyTable is defined as -
UID NOT NULL NUMBER
AGE NUMBER

Now, if the question that follows insert it trigger ORA-01722-
INSERT INTO testchild VALUES (5, 'your')
as the column AGE expects a number, but we provide a string.
So I want in my JDBC program for which column (here age) this error occurred.

Please help on this.

973637 wrote:
I am not fully aware of the ethics of this forum, but I don't think posting the same problem on several forums should create any problem.

To do this, if you get an answer on another forum and waste our time not to say things. This is why it is attentive to say where you have posted.

Tags: Oracle

Similar Questions

  • "evaluations thread jdi" has encountered a problem. Queue of the async thread exception handling.

    I'm trying to debug a java application on the Blackberry Pearl, using Eclipse v3.4.1. After the break on a line of code, I chose a variable in the 'Variables' tab and the following message appeared:

    "evaluations thread jdi" has encountered a problem.

    Queue of the async thread exception handling. java.lang.NullPointerException.

    java.lang.NullPointerException

    What kind of message is this, she comes from - and knowledge where I even begin to determine why this is happening. Perhaps can someone point me in the right direction.

    Thank you

    Steve

    Object that you are trying in this instance is Null.

  • Exception handling

    Hi, I create this procedure to make a mistake and save it:

    create or replace procedure as error_log

    number of n_code;

    n_massage varchar2 (100);

    Start

    Select 1 / 0 - here is the error

    Double;

    exception

    while others then

    n_code: = SQLCODE;

    n_massage: = SUBSTR (SQLERRM, 1, 100);

    INSERT INTO mistakes (e_id, code, message, e_time)

    VALUES (er_id.nextval, n_code, n_massage, sysdate);

    end;

    /

    And I get an error during the compilation of a procedure:

    PLS-00428: an INTO clause in this SELECT Line, 5.5 position statement

    Why do I get error if have written an exception that records all the errors?

    Exceptions handle run time errors (unknown error when compiling), you cannot create an exception for a syntax error.

    Notice which indicates the error: not that there is a division by zero, but there is an INTO clause expected.

  • Taskflow exception handler issues

    Hi all

    We have an ADF application deployed on Weblogic in Dev environment. A taskflow based on human labor BPM has a "ExHandler" view activity like exception handler. To test this, I inserted a "Dummy" dummy activity without application and navigation added to this activity of landing page "landing". When I tested this application flow correctly is the activity of the "ExHandler" exception exception handler.

    In another environment, the server is led by SST in SSO. When I tested the same scenario now, I get a 404 error instead of the activity of the exception handler. I captured the URL to which the request happens using a violin. The URL seems to be legitimate, because it is the same URL that I see in the Dev environment.

    In the OHS access history, I see two requests to "ExHandler".

    The first is a 302 with adf control state identical to that landing page "landing".

    Second, one is a 404 error with a different value for the adf State.

    All the world is facing this issue before? I got no idea about it. Any help is appreciated.

    JDev / ADF 11.1.1.7

    WebLogic - 10.3.6

    Kind regards

    SAI

    Problem solved. It was with cookie JSESSIONID. BPM human task URL is also a culprit (I should have checked that first). I gave the host name in the format "abc" instead of the full name of "abc.def.xyz". Although it works perfectly fine for normal scenarios, the issue does surface when I used the workflow exception handler activity. Initial demand was going on the 'abc' host, which created a JSESSIONID cookie. Later, when control is transferred to the exception handler activity, the request goes to 'abc.def.xyz' host. It resulted in creating new JSESSIONID by the system.

    I replaced the host name with "abc.def.xyz" instead of "abc", and this fixed the problem.

    Timo Hahn Thanks for your advice. I created a sample application and cannot reproduce the problem. Then I checked again carefully queries Fiddler and found the issue.

    Kind regards

    SAI

  • cursor for loops with exception handling

    Hi all

    I use oracle11g I need to write a stored procedure to about 10 select statements with the managements of exceptions for each select statement. I am unable to handle the exception handling.please guys help

    Here is the code sample I wrote

    CREATE OR REPLACE PROCEDURE TEST_PROC

    (P_ID IN VARCHAR2,

    P_MOB IN VARCHAR2,

    P_OUT_MSG OUT VARCHAR2)

    AS

    CURSOR CUR_RES AS SELECT NAME, INFO, VER_DETAILS FROM TABLE_NAME WHERE ID = P_ID AND MOBILE_NO IS P_MOB;.

    BEGIN

    FOR REC IN CUR_RES LOOP

    P_OUT_MSG: = 'BKY000. '

    END LOOP;

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    P_OUT_MSG: = 'BKY001. '

    END;

    OUTPUT DESIREE WHILE RUNNING IN A JAVA APPLICATION IS REQUIRED

    IF THE DATA FOUND BKY000 | RESULT OF THE SELECT STATEMENT

    IF DATA NOT FOUND BKY001

    PLEASE HELP WITH SAMPLE... PLEASE FRIENDS

    It's more clear now

    create or replace procedure test_proc (p_id in varchar2, )

    p_mob in varchar2,

    p_out_msg out varchar2,.

    p_result on sys_refcursor

    ) as

    v_err_msg varchar2 (300);

    row_count number;

    no_data_returned exception;

    nonunique_column exception;

    Start

    Open Select p_result *.

    WCP

    where deptno = to_number (p_id)

    and job = p_mob;

    Select count (*)

    in row_count

    WCP

    where deptno = to_number (p_id)

    and job = p_mob;

         

    If row_count = 0 then

    raise no_data_returned;

    end if;

    Select keep max (count (*)) (dense_rank first order by Count)

    in row_count

    from (select *)

    WCP

    Union all - simulating a duplicate line

    Select 7839, "ETBIN', 'PRESIDENT', null, trunc (sysdate), 3000, null, 10

    of the double

    )

    where deptno = to_number (p_id)

    and job = p_mob

    Group by empno

    view count (*) > 1;

    If row_count > 1 then

    raise nonunique_column;

    end if;

    p_out_msg: = 'BYK0000 ';

                       

    exception

    When no_data_returned

    then p_out_msg: = "BYK001";

    When nonunique_column

    then p_out_msg: = "BYK002";

    while others

    then v_err_msg: = ' procedure TEST_PROC: error: ' | SQLCODE. ': ' || substr (SQLERRM, 1, 200);

    raise_application_error(-20000,v_err_msg);

    end;

    declare

    R_C sys_refcursor;

    E_r emp % rowtype;

    E_m VARCHAR2 (255);

    DEPTNO number: = 10;

    VARCHAR2 (30) employment: = "PRESIDENT";

    Start

    dbms_output.put_line (' input parameters: deptno = ' | to_char (deptno) |) '; job = ' | Job);

    test_proc (to_char (DEPTNO), Job, E_m, R_C);

    dbms_output.put_line (' result: ' | e_m);

    If e_m = "BYK0000" then

    loop

    extract r_c in e_r;

    When the exit r_c % notfound;

    dbms_output.put_line (to_char (E_r.empno) |' |) '|| RPAD(E_r.Ename,10) |' | '|| RPAD(E_r.job,10) |' | '|| TO_CHAR (E_r.SAL, 'fm99990'));

    end loop;

    end if;

    exception

    While other then dbms_output.put_line ('exception: ' | sqlcode |) ': ' || substr (SQLERRM, 1, 200));

    end;

    input parameters: deptno = 10; job = PRESIDENT

    result: BYK002

    Statement processed.

    Concerning

    Etbin

  • Global exception handler

    Hello guys,.

    I'm trying to implement a handler for global exception (https://blogs.oracle.com/jdevotnharvest/entry/extending_the_adf_controller_exception_handler) by extending oracle.adf.view.rich.context.ExceptionHandler class and put the fully qualified name of the class that is implemented in the file .adf/META-INF/services/oracle.adf.view.rich.context.ExceptionHandler.txt .

    I see that it works locally jDeveloper (Studio Edition Version 11.1.1.6.0) when the built-in but server deployment does not work when it is deployed to the server of a dev... I see the folder has been created in the tmp folder in dev server and the file is there, not sure what else to try. Please help.

    Thank you

    Aerts

    OK finally solved! It was with the declaration of .adf/META-INF/services record - it seemed when the exception handler server deployment was not get registered. To debug the registered services, you must use the following.

    
              ServiceLoader compilers = ServiceLoader.load(ExceptionHandler.class);
                _logger.info(compilers.toString());
    
                for (ExceptionHandler compiler : compilers) {
                    _logger.info("******ExceptionHandler*********" + compiler);
                }
    

    If you check the loggers, the exception handler should be listed, otherwise then create a jar file with the class of exception handler and to put the issue of services along - with the file of exception handler (not a text file) within the META-INF of the jar file. Last step - put the jar file in WEB-INF/lib in your controller project.

  • 12 c call Webservice JDeveloper get "SQL string is not a DML statement" as a SQLException exception

    Hi guys,.

    I developed a java class to access the database using the OracleDataSource class and run a SQL query with a select statement. It works very well. I have built a wrapper class and as a Web service. I get "SQL string is not a DML statement" as a SQLException exception when I run as a Web service, but it works very well as an application.

    No idea why I get this error? Not sure why WebSercie is having a problem while this works as an application.

    Thank you and best regards,

    Srini Mel

    Solved the problem by myself.

    The first release "SQL string is not a DML statement" is due to an additional line (pstmt2.executeUpdate ()) in the code.

    Second question, receives not the query response is due to bad user input. I walked into 13.21651 instead of 31.21651.

    Thank you!

    Srini

  • Task workflow exception handler

    Hi all

    I'm trying to specify a method activity in an exception handler in the adfc-config. The problem is that if I specify a view activity or a workflow bounded as the exception handler then, it works very well, but if the exception handler is a method, then it is not recognized. What could be the cause? I need execute a method when an exception occurs.

    Version: 11.1.2.0

    Published by: NewBee on April 23, 2013 10:37

    Hello

    It should not be a problem with that and I recently did the same thing with JDeveloper 11 g R2 (do not know which version of JDeveloper you use because you did not share this information). I guess you checked only the activity of the method as an exception without any other configuration handler? If so, then set a breakpoint in the method managed bean that you access from the activity of the method to see if it actually stops. Also note that not all exceptions are handled by the controller exception handler. For example an exception during rendering of phase response (generally an exception in a bean managed) is not managed by the controller. You should also avoid the managed bean that handles the exception to throw a. This however you will see when you debug the bean.

    Frank

  • Exception handler, not shot context except for the Subscriber to events

    Hello

    Is it possible to make the activity of the exception handler when an exception is thrown by the Subscriber to the contextual events?

    In my application, as well a parent workflow and a child task flow (a task with fragments of page that is inserted into the parent company) have some activity of the exception handler.
    When an exception is thrown by one method other than the Subscriber to contextual events (for example, the action listener), the activity of the exception handler is triggered as expected.
    However, when the parent task flow publises a contextual event which is underwritten by the child workflows and the Subscriber throws an exception, the exception handler is triggered neither the parent nor the child workflows.

    Any help is appreciated.

    Thank you
    Kenji

    Hello

    function when the exception is thrown. The ADFc exception handler does not fire for exceptions that occur during the RENDER_RESPONSE phase (so it is one thing to check). In this case you must use a try-catch block. It also depends on what is exactly raining the exception (e.g. What is the bean of the code where the Manager, or a problem on the producer, is the involved link layer, etc.).

    Frank

  • ExceptionHandler implementation and activity marked as 'exception handler.

    Hello

    Please consider this sample application created using JDeveloper 11.1.1.3.0
    at http://www.consideringred.com/files/oracle/2010/CombinedExceptionHandlerApp-v0.01.zip

    It has an implementation of the ExceptionHandler configured in a services configuration file and config file adfc. XML that unbound the task path has a view activity "exceptionHandlerPage" marked as "exception handler.

    -scenario (sc1)
    Run the page browseDepartments.jspx and click on the button 'make throwMyViewRuntimeExceptionAction', resulting in a dialog box showing a FacesMessage created in MyViewExceptionHandler.handleException (), as shown in the screenshot CEHApp-001-sc1 - dialog.png.

    -scenario (sc2)
    Change the contents of the «.adf\META-INF\services\oracle.adf.view.rich.context.ExceptionHandler file"in a class name unknown, for example,"MyViewExceptionHandler"to"UnknownMyViewExceptionHandler ". (causing a java.lang.ClassNotFoundException when execution and application of ExceptionHandler therefore actually not custom configured)
    Run the page browseDepartments.jspx and click on the button 'make throwMyViewRuntimeExceptionAction', with the 'exceptionHandlerPage', showing the result of the EL expression result #{controllerContext.currentViewPort.exceptionData}, as shown in the screenshot CEHApp-001-sc2 - page.png.

    Based on the scenario (sc1) and (sc2), it looks like an implementation of the ExceptionHandler configured in a configuration file of services takes precedence over an activity in the boundless task marked as '' Manager exceptions '' flow.

    question:
    -(q1) is it expected behavior that an implementation of the ExceptionHandler configured in a services configuration file overrides an activity in the stream of boundless task marked as 'exception handler?

    Thank you very much
    Jan Vervecken

    Jan,

    Yes. Actually, the exception handler is called instead of the default AdfcExceptionHandler, which is the implementation that makes the activity of the labour exception handler. If you handle an exception in your custom exception handler class, up the machine again and the default mechanism is used.

    Frank
    PS. : If we woul do the opposite so you won't be able to change the behavior of management at all ;-) exceptions

  • How to designate a custom code in an exception handler

    Hello

    In the documentation "18.6.3 How designate of custom Code in an exception handler.
    at http://download.oracle.com/docs/cd/E14571_01/web.1111/b31974/taskflows_complex.htm#ADFFD22602
    section "to designate a custom code in an exception handler" says step 1
    ""In the navigation Application, expand the project where you want to write custom and navigate to the Application Sources/META-INF node.".
    Following these steps will result in a file in the wrong location
    SomeExceptionHandlerApp\ViewController\adfmsrc\META-INF\services\oracle.adf.view.rich.context.ExceptionHandler
    Whereas it should really be
    SomeExceptionHandlerApp\.adf\META-INF\services\oracle.adf.view.rich.context.ExceptionHandler
    also be cause the documentation says "Save the Java class that you write as a service in the." "adf\META-INF of your Fusion web application directory.

    Once in the right place the file is available from the "descriptors/ADF META-INF/services" node on the accordion of the navigation Application Application resources Panel.
    This Application resources panel does not seem to allow the creation of these services configuration files.

    issues related to the:
    -(q1) is step 1 in the section "to designate a custom code in an exception handler" a bug in the documentation?
    -(q2) what would be the best way to create these services using JDeveloper Setup files?

    Thank you very much
    Jan Vervecken

    Jan,

    I think we can use the new gallery to create the file. However, in this case you must ensure that you navigate to the correct directory (as you understand). Define a custom exception handler is not so common as Manager default ADFc is usually sufficient. I for my part usually create the file of configuration on the file system and do not use JDeveloper to this (but that's my personal preference). I'll keep a note about that and followed with the team of doc to correct chapter.

    Thank you

    Frank

  • ADF 11 g: exception handling problem

    Hi all

    Using Jdeveloper 11.1.1.2.0. I have a form of the ADF. The user will also be the primary key value. When I try to save the data by giving the primary key value that already exist.
    I'm more of exceptions in the Popup: -.

    Error
    Messages for this component are listed below.

    Error
    + Too many objects match the [RESERVE primary key] oracle.jbo.Key. +
    Error
    LocationType in RootAM.LocationAM1.LocationTypeVO1 attribute is required.
    Error
    LocationType in LocationTypeEO attribute is required.


    In the newspaper, I'm following exceptions: -.
    Exception = oracle.jbo.TooManyObjectsException: Houston-25013: too many objects match the [RESERVE primary key] oracle.jbo.Key.
    Exception = oracle.jbo.TxnValException: 27023 Houston: impossible to validate all the lines in a transaction.
    Exception = oracle.jbo.TxnValException: 27023 Houston: impossible to validate all the lines in a transaction.

    My requirement is to show a friendly message to the user as 'record already exists with the given value to < primary key field > ". I tried this by creating a class that extends the DCErrorHandlerImpl as below error handling custom: -.

    ' Public Sub reportException (DCBindingContainer bc, Exception ex) {}
    BindingContext ctx = bc.getBindingContext ();
    String err_code = null;
    System.out.println ("Exception =" + ex);
    If (ex instanceof TxnValException) {}
    Handle Houston-27023
    err_code = ((TxnValException) ex) .getErrorCode ();
    If (Integer (err_code) .intValue (new) == 27023) {}
    this.getDisplayMessage (ctx, ex);
    System.out.println ("Houston-27023 handshake');
    }
    }
    If (ex instanceof oracle.jbo.TooManyObjectsException)
    {
    FacesContext context = FacesContext.getCurrentInstance ();
    context.addMessage (null, new FacesMessage (FacesMessage.SEVERITY_ERROR, "record already exist", null));
    }
    }



    Even with above approach I get "Record already exists" instead of "too many objects correspond to the oracle of primary key. But still I'm getting following error in popup messages: -.
    Error
    LocationType attribute in RootAM.LocationAM1.LocationTypeVO1 is necessary.
    Error
    LocationType in LocationTypeEO attribute is required.

    (1) how can I remove the above popup messages. (2) and is there a better approach to exception handling then this in ADF 11 g?

    Thanks in advance,
    Vikram

    Published by: Vikram K on May 28, 2010 19:08

    That's the problem with the unfounded primary keys sequence.
    One way you can avoid cela in setting mandatory flag as false for this attribute of the entity.

    You can also catch the TooManyObjectsException in the setAttribute method in EOImpl and keep the generic exception handler.

    SID

    Published by: manieshsailoz on May 28, 2010 11:11

  • Exception handler does not work

    Hi guys,.
    My feature works very well when the input of user name and password are correct. I'm trying to understand why my exception handler does not display the contents of the DBMS_OUTPUT. Put_line when the user name or password are not correct. Any ideas?
    Thank you
    Carpet


    G_output VARIABLE VARCHAR2 (30)
    G_username VARIABLE VARCHAR2 (8)
    G_password VARIABLE VARCHAR2 (8)
    G_ck VARIABLE CHAR


    BEGIN
    : g_username: = 'gma1;
    : g_password: = 'Michael ';
    : g_ck: = 'n';
    END;
    /


    CREATE OR REPLACE PACKAGE login_pkg
    FUNCTION log_in_pf
    (p_username IN VARCHAR2,
    p_password IN VARCHAR2,
    p_ck IN OUT the TANK)
    RETURN OF CHAR;
    END;
    /


    CREATE OR REPLACE PACKAGE BODY login_pkg
    FUNCTION log_in_pf
    (p_username IN VARCHAR2,
    p_password IN VARCHAR2,
    p_ck IN OUT the TANK)
    RETURN OF TANK
    IS
    lv_username_txt bb_shopper.username % TYPE;
    lv_password_txt bb_shopper.password%TYPE;
    BEGIN
    SELECT username, password
    IN lv_username_txt, lv_password_txt
    OF bb_shopper
    WHERE username = p_username
    AND password = p_password;
    IF lv_username_txt | lv_password_txt = p_username | p_password THEN
    p_ck: = 'Y ';
    ANOTHER p_ck: = 'n';
    END IF;
    RETURN p_ck;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    DBMS_OUTPUT. Put_line ('Invalid username or password');
    END log_in_pf;
    END;
    /




    BEGIN
    : g_output: = login_pkg.log_in_pf (: g_username,: g_password,: g_ck);
    END;
    /

    BEGIN
    *
    ERROR on line 1:
    ORA-06503: PL/SQL: function returned no value
    ORA-06512: at "SCOTT. LOGIN_PKG', line 23
    ORA-06512: at line 2

    Published by: Mathew2 on July 20, 2009 03:20

    Maybe: In SQL * more set serveroutput on

    Published by: jurgenk on July 20, 2009 03:58

  • on exception handling in function, while using this function in sql

    Hi gurus,

    I have a question concerning the registration of exceptions when using functions.

    I wrote a separate package to handle errors, where I have a procedure.
    In this process, I connect my error in a table and then triggers the error on the front end.
    Ex:
    proc_log_and_raise    -- this proc... inserts my error into a table and then raise
    now, I have included this error procedure in all functions and procedures.

    Consider an example with an example of procedure and function.
    function func_1(( v_var   varchar2) return varchar2 is
    begin
         select   column2
         from     table2
        where col1 = v_var;
    exception 
        when others then 
             proc_log_and_raise;
    end;   
    procedure proc_1( v_var   varchar2) is
    begin
        select   func_1(v_var)  -- error occurs here..
        from     table_a
        where   col1 = v_var;
    exception 
        when others then 
             proc_log_and_raise;
    end;    
    now I do
    exec  proc_1( v_var );
    but now my problem is, when an error occurs in func_1, I get an error with the DML operation (as we are inserted in the table of errors)
    ORA-14551: cannot perform a DML operation within a query.

    So what I want to do, connect the two functions and procedure where the error occurred.

    So is it better otherwise, we can write our exception handling, so that I could mistake the newspaper and use the function in a select statement.

    Thank you.

    A small example of using autonomous transactions

    create table error_log (error varchar2(4000));
    
    Table created.
    
    SQL> create procedure log_error(p_error in varchar2) as
      2  pragma autonomous_transaction;
      3  begin
      4  insert into error_log values (p_error);
      5  commit;
      6  end;
      7  /
    
    Procedure created.
    
    SQL> create function will_fail return number as
      2  begin
      3  for x in (select 2/0 from dual) loop
      4  null;
      5  end loop;
      6  exception
      7  when others then
      8  log_error(sqlerrm);
      9  raise;
     10  end;
     11  /
    
    Function created.
    
    SQL> create procedure call_will_fail as
      2  begin
      3  for x in (select will_fail from dual) loop
      4  null;
      5  end loop;
      6  end;
      7  /
    
    Procedure created.
    
    SQL> exec call_Will_fail;
    BEGIN call_Will_fail; END;
    
    *
    ERROR at line 1:
    ORA-01476: divisor is equal to zero
    ORA-06512: at "WILL_FAIL", line 9
    ORA-06512: at "CALL_WILL_FAIL", line 3
    ORA-06512: at line 1
    
    SQL> select * from error_log;
    
    ERROR
    -----------------------------------------------------------------
    ORA-01476: divisor is equal to zero
    

    Note that the recovery is carried out by the exception handler.

  • PL/SQL exception handling and return values

    Hi all

    I use Oracle 10.2.0

    I have a problem in the return values of the procedures if there is no exception.

    For example:

    procedure a.
    (
    P_in number,
    p_out on varhar2
    )
    as
    p_valid varchar2 (10);
    number of p_no1;
    Select 1 in double p_no1;
    B (p_valid, p_no);
    exception when others then
    c (errmsg);
    end;
    put an end to;
    procedure B
    (
    p_in number,
    p_valid out varchar2
    )
    as
    fake number;
    Select 1 in double dummy;
    dummy cases = 1
    then
    p_valid = "OK".
    C (MSG);
    end;
    exception when others then
    p_valid = "OK".
    C (errmsg);
    end;

    end b;
    In the example if theres no exceptions or dummy = 1 in procedure B, then I need to return the value as 'OK' in the setting out of the parent procedure "A".

    I could not this value, returning null. How to get this...

    Please advice...

    TIA,

    ORCLDB wrote:
    Hi all

    I use Oracle 10.2.0

    I have a problem in the return values of the procedures if there is no exception.

    Ok

    The code you have posted is not valid code if you have forgotten some important things. However, we will make it simple...

    If you have a set OUT that will not be filled if an exception is thrown, unless it is set to NOCOPY.

    Example of...

    Here, we regularly parameter output and when an exception occurs in procedure B it REVIVAL of the exception to the procedure a...

    SQL> ed
    Wrote file afiedt.buf
    
      1  create or replace procedure B (p_in in number, p_valid out varchar2) as
      2    dummy number;
      3  begin
      4    select 1 into dummy from dual where p_in = 1;
      5    p_valid := 'OK';
      6  exception when others then
      7    p_valid := 'EXCEPTION';
      8    raise;
      9* end b;
    SQL> /
    
    Procedure created.
    
    SQL> create or replace procedure A (p_in in number) as
      2    v_valid varchar2(10);
      3  begin
      4    B(p_in, v_valid);
      5    dbms_output.put_line('Returned without exception: '||v_valid);
      6  exception when others then
      7    dbms_output.put_line('Returned with exception: '||v_valid);
      8    raise;
      9  end A;
     10  /
    
    Procedure created.
    
    SQL> exec a(1);
    Returned without exception: OK
    
    PL/SQL procedure successfully completed.
    
    SQL> exec a(2);
    Returned with exception:
    BEGIN a(2); END;
    
    *
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at "SCOTT.A", line 8
    ORA-06512: at line 1
    

    Obviously, when the procedure B raised an exception it went directly to the procedure exceptions A manager that indicates that an exception has happened and the value returned in the OUT parameter was NULL.

    Now, if procedure B just handles the exception rather than erect in...

    SQL> ed
    Wrote file afiedt.buf
    
      1  create or replace procedure B (p_in in number, p_valid out varchar2) as
      2    dummy number;
      3  begin
      4    select 1 into dummy from dual where p_in = 1;
      5    p_valid := 'OK';
      6  exception when others then
      7    p_valid := 'EXCEPTION';
      8* end b;
    SQL> /
    
    Procedure created.
    
    SQL> exec a(1);
    Returned without exception: OK
    
    PL/SQL procedure successfully completed.
    
    SQL> exec a(2);
    Returned without exception: EXCEPTION
    
    PL/SQL procedure successfully completed.
    

    Here, procedure B fills the output parameter and just returns execution to the block to execute procedure A, so A procedure isn't aware of no exception, but the output parameter does not contain the value B populated with.

    But if you want the procedure B to throw the exception and pass out a value in the output parameter, you must set the out parameter as NOCOPY...

    SQL> ed
    Wrote file afiedt.buf
    
      1  create or replace procedure B (p_in in number, p_valid out NOCOPY varchar2) as
      2    dummy number;
      3  begin
      4    select 1 into dummy from dual where p_in = 1;
      5    p_valid := 'OK';
      6  exception when others then
      7    p_valid := 'EXCEPTION';
      8    raise;
      9* end b;
    SQL> /
    
    Procedure created.
    
    SQL> exec a(1);
    Returned without exception: OK
    
    PL/SQL procedure successfully completed.
    
    SQL> exec a(2);
    Returned with exception: EXCEPTION
    BEGIN a(2); END;
    
    *
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at "SCOTT.A", line 8
    ORA-06512: at line 1
    
    SQL>
    

    Now, as in the first example, procedure B defines the output parameter and throws the exception, causing execution to go directly to the procedure A exception handler, but this time, A procedure return parameter value out.

    To understand the execution of blocks and managing exceptions take a look at this article...

    [PL/SQL 101: exception handling | http://forums.oracle.com/forums/thread.jspa?threadID=697262&tstart=50]

    ;)

Maybe you are looking for

  • Dashboard of data error

    Good afternoon friends, and had some problems with the mobile app on my tablet. the problem is that after that the completion of the project in LabVIEW when I connect to the IP address of my pc to Tablet gives me this error "invalid login error. Serv

  • How are Tone defined HB (RMS, peak) power PORT?

    Hello Just thought on how is the PORT HB your powers defined. Example for a PORT1 (1 your HB Source, 40dBm), it is said the Pwr is the amplitude. This means that it is a middle power, RMS power, or absolute maximum power?

  • NOn HP ink for HP Envy 4500

    I bought ink cartridges for the HP printer HP HP sent me to sell me a lemon of a computer. The printer will print with ink HP no. It is legal and what I can do to make an impression with these cartridges from the printer?

  • want to 4500: printer

    Hello My printer is the type of China, hov can I change, because I can't read what the screen show me, hov can return to revive again in my launges?

  • HP p6653w: which processors will be support of HP p6653w motherboard?

    Which processors will be support of HP p6653w motherboard? Is it worth the upgrade?  I even with 16 GB of RAM, boot the system takes about 10 minutes.  I have the AMD Athlon II X 2 250 processor processor, which is not necessary for this discussion,