Exception management

Hello

I created a new project of the adf on jdeveloper. I have a class in the other project that runs smoothly but when I copy some functions of old project from my new jdeveloper class shows some warnings "Unhandled Exception" even same functions library.

I also tried on Eclipse, there was no error.

first the image, there is no error.

second image has an error

Lots of error: new exception Thor.API.Exceptions.tcAPIException; must be captured or declared adjourned

Untitled1.jpgUntitled2.png

How can with this error?

It seems that this exception class is in a pot, which is missing from the source/classpath of the project. You can add the jar to the project? and discover the properties of the classpath project check if the jar in question is present or not.

Arun-

Tags: Java

Similar Questions

  • How to properly code for exception management?

    Hey you wonderful people you

    I have a quesiton on how to correctly code in PL/SQL for exception management. Here is my code below, I was told that how I use in my script of exception handling is simply not true.

    Can someone please adjust the section where I use the management of exceptions and show me what is the appropriate way to deal with exceptions.

    Here is the table creation script, so you can see what how the script fills the table DYNAMIC_COUNTS.

    --------------------------------------------------------------------------------------------------------------------------

    CREATE TABLE DYNAMIC_COUNTS

    (VARCHAR2 (30 BYTE) "T_OWNER",

    VARCHAR2 (30 BYTE) "T_TABLE_NAME."

    VARCHAR2 (30 BYTE) "T_COLUMN_NAME."

    NUMBER OF 'FND_PATTERNS');

    Now, here's the script:

    ------------------------------------------------------------------------------------------------------------------------

    Set serveroutput size unlimited
    run the DBMS_OUTPUT. ACTIVATE (buffer_size = > NULL);

    DECLARE

    TYPE nt_tab IS TABLE OF dynamic_counts % ROWTYPE;

    v_nttab nt_tab: = nt_tab();

    FND_LOOK INTEGER.

    v_incr NUMBER: = 0;

    ------------------------------------------------------------------------------------------------------------------------

    BEGIN

    FOR t IN (SELECT master, table_name, column_name

    From all_tab_columns

    Owner WHERE = UPPER ('& SCHEMA_NAME'))

    ------------------------------------------------------------------------------------------------------------------------

    LOOP

    BEGIN

    EXECUTE IMMEDIATE ' with an ACE (select case when REGEXP_LIKE (' | t.column_name |))

    -This search 1 letter and 12 figures-
    ', "^ ([[: alpha:]] |) [[: alpha:]] ({3}) [0-9] {12} $")



    then "match"

    another "no matches found" end up as output of ' | t.Owner | '.' || t.table_name | ')

    Select count (*) in a where a.output = "Match Found" clause '


    IN FND_LOOK;


    ------------------------------------------------------------------------------------------------------------------------
    IF FND_LOOK > 0 THEN

    v_incr: = v_incr + 1;

    v_nttab. EXTEND;

    v_nttab (v_incr) .t_owner: = t.owner;

    v_nttab (v_incr) .t_table_name: = t.table_name;

    v_nttab (v_incr) .t_column_name: = t.column_name;

    v_nttab (v_incr) .fnd_patterns: = FND_LOOK;

    END IF;

    ------------------------------------------------------------------------------------------------------------------------
    / * This is for DBMS output, thus we have 2 different ways, one can see the results in the table dynamic_counts
    and in the dbms_output
    */


    IF FND_LOOK > 0 THEN


    Dbms_output.put_line (t.owner |) '.' || t.table_name | ' ' || t.column_name | ' ' || FND_LOOK);



    END IF;


    ------------------------------------------------------------------------------------------------------------------------

    / * Exception handling * /.



    EXCEPTION

    WHILE OTHERS

    THEN

    Dbms_output.put_line)

    "Generic error".

    || t.column_name

    || "from".

    || t.Owner

    || '.'

    || t.table_name);

    END;

    END LOOP;

    ------------------------------------------------------------------------------------------------------------------------

    FORALL i IN 1.v_nttab. COUNTY

    INSERT INTO dynamic_counts (t_owner,

    t_table_name,

    t_column_name,

    fnd_pattens)

    VALUES (v_nttab (i) .t_owner,

    v_nttab (i) .t_table_name,

    v_nttab (i) .t_column_name,

    v_nttab (i) .fnd_patterns);

    COMMIT;

    END;

    /


    Isn't there. In the statement in the EXCEPTIONS section dbms_output.

  • common code in oracle exception Manager

    Hi all

    Here is the situation where I'm stuck...
    The current code handles all errors as shown below:
    WHILE OTHERS
    THEN
    IF cur_hdr % ISOPEN
    THEN
    CLOSE Cur_hdr;
    END IF;

    IF cur_det % ISOPEN
    THEN
    CLOSE Cur_det;
    END IF;

    ECODE: = SQLCODE;
    emesg: = v_trace_str | SQLERRM;
    SM_CONTROL_PKG.
    handle_db_error (v_package_name |) '.' || v_procedure_name,
    emesg,
    v_trace_str,
    (TRUE);
    V_RETVALUE: = 1;
    ROLLBACK;
    end;


    Now, I was asked to introduce an error more, it is a user-defined error.
    so I defined
    no_detail_for_header_ex EXCEPTION;

    In my code, I say,
    Open the cursor in the header
    Open detail slider - there no line

    So I say
    v_trace_str: =' no details for header-ERROR '
    Rossanna no_detail_for_header_ex;

    But in part, exception management
    I say,

    When no_detial_for_header_ex then
    IF cur_hdr % ISOPEN
    THEN
    CLOSE Cur_hdr;
    END IF;

    IF cur_det % ISOPEN
    THEN
    CLOSE Cur_det;
    END IF;

    ECODE: = SQLCODE;
    emesg: = v_trace_str | SQLERRM;
    SM_CONTROL_PKG.
    handle_db_error (v_package_name |) '.' || v_procedure_name,
    emesg,
    v_trace_str,
    (TRUE);
    V_RETVALUE: = 1;
    ROLLBACK;


    If you can see, the code is the same.
    close cursors and call the handle_db_error.

    I don't want to code the same thing again.
    Here, errors are different, but handled the same way. only the trace_str varies.

    I want to write something like
    When no_detial_for_header_ex or other PEOPLE can
    same code.

    is this possible with others.
    or any other suggestions.

    Thnaks in advance.

    Sure. Just declare the parameters in your cursor, then move them during the call of loop.

    cursor my_cursor (my variable)
    is
    select .... from .... where column = my variable;
    
    for cursor_rec in my_cursor (my value)
    loop
       ...
    end loop;
    

    A google for cursor for loop syntax should clear up any questions. Consider reading the Oracle pl/SQL and documentation.

  • Package exception management

    Hi all

    I have a package like
    create package test_lonely as
    
    .....variables
    procedure procedure1;
    end;
    similar to package body
    procedure procedure1 as
    begin
    procedure2();
    procedure3();
    end;
    + DDL for procedure2 and 3
    where should I place the exception block? It should can only "while OTHERS"

    (1) as it has been said, you almost never want to have an exception for WHEN OTHERS handler anywhere in your code.
    (2) as has already said, if you really want to have a WHEN OTHERS exception handler, the exception handler must include a statement of RECOVERY. The exception handler you posted will swallow the exception, check the error stack and do nothing to inform the appellant that an error has occurred while the appellant has no way to know if the call succeeded or failed.
    (3) as a general rule, you should only be catch the exceptions that you can manage wisely. All others can spread to the appellant.
    (4) you put not managers of exceptions in the package body. You put them in any procedure (s) in the package that you want to catch the errors. A package is just a wrapper to contain several functions and procedures.

    If you want to catch exceptions in procedure1, for example

    procedure procedure1 as
    begin
      procedure2();
      procedure3();
    exception
      when some_expected_exception
      then
        do_something_useful_with_the_exception
    end;
    

    Justin

  • Question about exception management

    DB version: 10.2

    We have several procedures in a package. All exception handling procedures be made as below
    when others then
           dbms_output.put_line(sqlerrm);
           raise_application_error(-20002, sqlerrm);
    end mystoredproc;
    Lets say I have A, B, C and D lined up for execution of procedures. While running, what happens if procedure B has encountered an error and is managed by raise_application_error thingy, it will stop the execution of other procedures C and D as well?

    John_75 wrote:

    We have several procedures in a package. All exception handling procedures be made as below

    Then all your exception handling procedures are flawed.

    The results of PL/SQL engine in an exception explicitly being raised with a unique error code. Your exception handlers that take and change this exception in an error of-20002 code empty.

    It's downright put silly to deal with exceptions.

    There are 3 fundamental reasons to deal with an exception.

    (1) it is not an error of the company. For example to get a NO_DATA_FOUND for a function of product disc0unt is not an error and simply means that the product is not disc0unted. In this case, the exception is removed and applied relevant business logic.

    (2) the error relates to the very specific business logic/rules and can be transformed into a very useful application error. For example, if an DUP_VAL_ON_INDEX exception for this specific code means company error "+ product category already exists + ' and the code returns a unique error code and a message for it.

    (3) protection of resources. For example, a LOB Locator was created and must be released if there is an error, otherwise there will be resource leaks. So, the exception is caught, the resources released (or app error log update, etc.) - after which the exception is relaunched.

    If you can not check one of these 3 reasons for the existence of an exception (in any programming language) handler, then you are most likely all wrong exception.

  • The ViewObject exception management

    I use ADF w/BC in JDeveloper 10.1.3.3.

    I'm new to ADF. The previous programming experience using other languages, I'm used to catching exceptions when executing an sql query. When I do an executeQuery on a ViewObject, how intercept all exceptions. For example, if the database is inaccessible, I would expect executeQuery to fails and throws an exception.

    Thank you

    John

    Hello

    refer to the documentation

    1. the error thrown when the database is not available

    http://download-UK.Oracle.com/docs/HTML/B25947_01/deployment_topics013.htm#CIHBIHCI

    2. error in the ADF management

    http://download-UK.Oracle.com/docs/HTML/B25947_01/web_val008.htm

    Frank

  • system thread exception managed not blue screen

    Hi support, I have problem blue screen when I turn on my computer...

    This is the report I got from nirsoft BlueScreenView

    050815-45234 - 01.dmp 8 May 15 20:20:02 SYSTEM_THREAD_EXCEPTION_NOT_HANDLED 0x1000007e ffffffff "c0000005 fffff880 '01748e52 fffff880' 00bf9508 fffff880 ' 00bf8d40 fltmgr.sys fltmgr.sys + 1e52 Microsoft Filesystem Filter Manager Microsoft® Windows® operating system Microsoft Corporation 6.2.9200.16384 (win8_rtm.120725 - 1247) x 64 fltmgr.sys + 1e52 C:\Windows\Minidump\050815-45234-01.dmp 4 15 9200 285 040 8 May 15 20:21:24

    Can someone help me?

    These accidents were related to the corruption of memory (probably caused by a driver).

    Run these two tests to check your memory and find which driver is causing the problem.  Launch auditor.  You need not run memtest again unless you want to.

    If you are overclocking anything reset by default before running these tests.
    In other words STOP! If you don't know what it means that you're probably not  


    1-Driver Verifier (for full instructions, see our wiki here)

    2-Memtest. (You can learn more about running memtest here)


  • Continue the block after the exception management

    The guys in the slot block.

    create or replace procedure proc_case
    (p_in IN number)
    is
    begin
    case p_in
    when 1 then
    dbms_output.put_line('its one'); 
    when 2 then
    dbms_output.put_line('its two'); 
    end case;
    dbms_output.put_line('after the exception handler'); 
    exception when case_not_found then
    dbms_output.put_line('its not found'); 
    end;
    

    When the procedure is executed as follows.

    begin
    proc_case(3);
    end;
    

    It shows the statement in the block of exception, but after that it does not run the statement following the exception handler and the outputs of the block, how can I execute the statement after the end case statement. I do not use the Else statement in case because I wanted to understand the logic of this block.

    CREATE OR REPLACE

    PROCEDURE proc_case

    (

    p_in in NUMBER)

    IS

    BEGIN

    BEGIN

    P_in CASE

    WHEN 1 THEN

    dbms_output.put_line ('the one');

    WHEN 2 THEN

    dbms_output.put_line ('two');

    END CASE;

    EXCEPTION

    WHEN case_not_found THEN

    dbms_output.put_line ("' its not found");

    END;

    dbms_output.put_line ("' after the exception handler");

    END;

  • Restore when exception management

    Hello

    I'm trying to handle errors between each DML statements. When the code runs and it fails between the DML and half of the tables are engaged and gives me the unexpected result.

    Please let me know how to avoid this?

    Each DML statement must be written with each block error handling? or otherwise better than this using savepoint?

    Start

    Insert instruction 1;

    commit;


    Insert the 2 declaration;

    commit;


    Update statement 1

    commit;


    Remove the statement 1;

    commit;

    EXCEPTION

    WHEN DUP_VAL_ON_INDEX THEN

    proc_stat_util.write_msg ('E', ' constraint Unique error: Please check if a file is there to ' | v_tablename |) 'table');

    raise_application_error (-20001, ' constraint Unique error: Please check if a file is there to ' | v_tablename |) 'table');

    WHILE OTHERS THEN

    ROLLBACK;

    RAISE_APPLICATION_ERROR (-20001, "ORACLE ERROR: ' |") DBMS_UTILITY. FORMAT_ERROR_STACK);

    End;

    Thank you very much in advance

    user12093849 kirjoitti:

    I'm doing the several DML statements (25 DML statements within a procedure) one after the other. When one of the DML fails, he must get out all of the code without committing the previous executed the DML statements. But the above is not what is expected.

    Thank you

    I suggest you do not commit or rollback in your business procedures or functions other than logging in a separate transaction, called autonomous_transaction.

    How you never know what caused commit when you have dozens of program here and there. What happens if you need for any operation restoration and it is called the old procedure, which make and you do not remember or know that (because the other developer put there).

    That's all, there is no way back and the current restore operation. Data are now inconsistent and it is severe bug and against the basic principle of data base.

    So let this customer of your commit or rollback NOT business blocks (procedures/functions). Of course that the client may be a procedure or a function. But he must be separated from your building blocks of business and is usually a single program. It is in a pattern of façade of sense.

    Other methods are the transaction context that implement application servers and it is decided on commit or rollback. He (pl/sql) is no reason never commit or rollback except in autonomous_transaction.

    It's more about a design problem. These operations must be designed correctly, then you can do the pl/sql code that is modular and easy to maintain and that 'client' contains commit or rollback so that your data is in a consistent state in the database after the commit or rollback.

  • Exception management - inside the procedure

    Hello

    I'm trying to insert records into our target within a cursor table.

    (For after the analysis of the values of the Source table and to make changes in the format of the value and insert into the target table)

    I need to capture the exception within the cursor and save these exception in an error table.

    I use the exception within the cursor for loop block.

    example code:

    C1 loop c_cursor1

    Start

    ... Insert the statement after the analysis of the values...

    exception

    while others

    then

    DBMS_OUTPUT. Put_line (' error code: ' |) SQLCODE);

    dbms_output.put_line (' error: ' |) SQLERRM);

    end;

    end loop;

    Examples of exception scenarios:

    1)

    Error report:

    ORA-01476: divisor is equal to zero

    ORA-06512: at "APX_DEVELOPMENT. PKG_CUSTOMER_FEDERATION', line 165

    ORA-06512: at line 3 level

    01476 00000 - "the divisor is equal to zero.

    Error code: - 1476

    Error message: ORA-01476: divisor is equal to zero

    2)

    Error report:

    ORA-12899: value too large for column 'APX_DEVELOPMENT '. "" "" RG_ORIGINATOR '. "" CREATED_BY' (real: 14, maximum: 10)

    ORA-06512: at "APX_DEVELOPMENT. PKG_CUSTOMER_FEDERATION', line 133

    ORA-06512: at line 3 level

    12899 00000 - "value too large for column %s (actual: %s, maximum: %s)).

    Error code: - 12899

    Error message: ORA-12899: value too large for column 'APX_DEVELOPMENT '. "" "" RG_ORIGINATOR '. "" CREATED_BY' (real: 14, maximum: 10)

    I use SQLCODE and SQLERRM to capture the codes and messages.

    But how to capture the package or the procedure name, and line number.

    for example. I need to capture something like below

    ORA-06512: at "APX_DEVELOPMENT. PKG_CUSTOMER_FEDERATION', line 165

    ORA-06512: at "APX_DEVELOPMENT. PKG_CUSTOMER_FEDERATION', line 133

    How to get to this

    Thanks in advance for your help.

    Please let me know for further details.

    Use dbms_utility.format_error_backtrace... Check below...

    http://docs.Oracle.com/database/121/ARPLS/d_util.htm#i1003874

    Thank you

    Ann

  • FOR exception management loop

    Given the following code:
    for x in my_cursor loop
        begin
            <<stmt_1>>
            <<stmt_2>>
        exception
            when others then
                <<log_error>>
        end;
    end loop;
    Say there are 5 x in my_cursor. On the element x 3, stmt_1 works fine but stmt_2 throws an exception. I would like to restore ONLY the work done on x 3 (in this case, stmt_1), then continue the loop of the next element, x 4. Can this be achieved with a combination of backup/restore point?

    In this particular case, I would suggest that you follow the third example I posted where you stand on the core of your loop in a procedure such that you change only the values of a and b If your insert succeeds, that is

    CREATE OR REPLACE PROCEDURE proc_name( p_x IN NUMBER, p_a IN OUT NUMBER, p_b IN OUT NUMBER )
    AS
      l_tmp_a NUMBER;
      l_tmp_b NUMBER;
    BEGIN
      SAVEPOINT s1;
      l_tmp_a := p_a + p_x;
      l_tmp_b := 1/(6-l_tmp_a);
      INSERT INTO test_tbl VALUES( l_tmp_a, l_tmp_b );
      p_a := l_tmp_a;
      p_b := l_tmp_b;
    EXCEPTION
      WHEN <>
      THEN
        ROLLBACK TO SAVEPOINT s1;
    END;
    

    You can, of course, have the same local variables of the TMP in your original code. Or you could replicate the calculations, i.e.

    for x in 1..5 loop
    begin
      savepoint s;
      insert into test_tbl values(a+x,1/(6-a));
      a := a+x;
      b := 1/(6-a);
    exception
      when others then
        rollback to savepoint s;
    end;
    

    Justin

  • Steven Feuerstein pdf exceptions management.

    Hello

    I'm posting here so that I can get feedback on this subject we have.

    Here is the PDF file.

    http://www.quest.com/presentations/ExceptionHandling.PDF

    In this, he mentions that must be used:
    PROCEDURE raise (err_in IN INTEGER) IS
      BEGIN
        IF err_in BETWEEN -20999 AND -20000
          THEN
            RAISE_APPLICATION_ERROR (err_in, errtext (err_in));
        ELSIF err_in IN (100, -1403)
          THEN
            RAISE NO_DATA_FOUND;
        ELSE
          EXECUTE IMMEDIATE
           'DECLARE myexc EXCEPTION; ' ||
           ' PRAGMA EXCEPTION_INIT (myexc, ' ||
           TO_CHAR (err_in) || ');' ||
           'BEGIN RAISE myexc; END;');
        END IF;
    END;
    It suggests the use of this procedure whenever you have to 'revive', you will need to use 'exception so that others'.

    Now, here's my question:

    What BIND VARIABLES in the block "immediate execution" of the procedure.

    Whenever there are errors in the program, then, this procedure would FILL up my shared pool, it doesn't? (I checked and he did).

    I tried to use the link using the "USING" construction and it did not work. I find reason: the substitution is BEFORE the BEGIN statement in the DECLARE block.

    If I'm unclear in my question, please let me know.

    We try to implement this feature in our code, but then I asked this question and could not get a response in our shop.

    Thank you for reading.

    Hello Rahul,

    I don't know what to do now.

    I can relate to that after reading:

    my approach was found to be useless (I have write the 'log_error' and 'recovery' - two instructions every time)

    Makes me assume that probably you are not able to ask them "why" or "proof your approach is wrong" (or prove "those who you judge" were not right). I have the feeling it has to do with the maintenance of a living datamodel, which could use/needs a few adjustments here and there. This in fact a "political issue."
    Apparently, all "those who have the power to consider other" missing a few points.
    They always go to the supermarket, put 1 point in their basket, pay, walk to the car, point load in the car, back to supermarket, get the order of the day, pay, etc etc until they have all the elements that are on the list of their car.
    In other words: they are still "slow by slow. Or: they delibaratly ignore the fact that they can put 400 + items in their cart and load everything in their trunk as well.
    (Because they are paid for each round trip and they love and want to keep the greedy people of learning ignorant?)

    Meanwhile the database can handle so many things these days.
    To search for a certain file zipped on the file system, unpack it and automatically load in an external table and deal from there on would you? Hey, it can be done. It's all there already.
    But some people don't like this idea.

    Once again:
    Don't get me wrong, but this has nothing to with an approach to dealing with exceptions on a well-thought basis.
    No, instead, we're going to do all the 'generic' and 'dynamic '.
    You're already aware of this.
    This has to do with you be retained as a developer wanting to explore and exploit all the features of database available and be able to evolve.

    Just my

    $
    ----
    0.02
    
  • OSB-maxOccurs = "5" exception management

    Hello

    Is there a better way to handle the exception when the element of the request message is more than maxOccurs = "5", for example the following query body is greater than 5, can the OSB proxy captures the error? or I need to generate an error in the pipeline?

    < soapenv:Body >
    < RequestHdr >
    < bsm:RequestId > stringstringstringstringstringst < / bsm:RequestId >
    < bsm:ReqTransactionId > 100 < / bsm:ReqTransactionId >
    < / RequestHdr >
    < RequestHdr >
    < bsm:RequestId > stringstringstringstringstringst < / bsm:RequestId >
    < bsm:ReqTransactionId > 100 < / bsm:ReqTransactionId >
    < / RequestHdr >
    ........

    I think this is exactly the case for which you must use action validate:
    http://download-llnw.Oracle.com/docs/CD/E13159_01/OSB/docs10gr3/consolehelp/proxyactions.html#wp1273434

  • Triggers and exception management

    I'm only learning how to use triggers so if it is a stupid, sorry question about it!

    I created 2 tables, one called PRODUCT_PRICES (PRO_ID NUMBER, NUMBER of PRICE) and the other called PRICE_RANGE (PRO_ID, NUMBER MAX_PRICE, NUMBER of MIN_PRICE).

    What I'm supposed to do, is create a before insert or update trigger on the table product_prices that emits 2 errors:
    1. "no such product" when PRO_ID is not in the table PRICE_RANGE
    2. "the price... is not the product range.."

    That's what I have so far:
    CREATE OR REPLACE TRIGGER PRODUCTS_PRICES_TRG
    FRONT
    INSERT OR UPDATE
    ON PRODUCT_PRICES
    FOR EACH LINE
    DECLARE
    INVALID_PRODUCT EXCEPTION;
    INVALID_PRICE EXCEPTION;
    BEGIN
    IF (: NEW.PRO_ID TO PRICE_RANGE) THEN
    RAISE INVALID_PRODUCT;
    ELSE IF (: PRICE_RANGE PRICE > = MAX_PRICE OR < = MIN_PRICE) THEN
    RAISE INVALID_PRICE;
    END IF;
    EXCEPTION
    WHEN INVALID_PRODUCT THEN
    BEGIN
    RAISE_APPLICATION_ERROR (-20001, "NO SUCH PRODUCT");
    END;
    WHEN INVALID_PRICE THEN
    BEGIN
    RAISE_APPLICATION_ERROR (-20002, "THE PRICE IS NOT IN THE RANGE OF PRODUCT '");
    END;


    I think I leave me puzzled, I don't really know how start it section with the statements fi works and I don't know how to use 2 tables with a trigger like this. Any suggestion would be great.

    It's just that there is a 'number' after the column name, probably a thing of copy/paste ;)

    CREATE OR REPLACE TRIGGER PRODUCTS_PRICES_TRG
        BEFORE INSERT OR UPDATE
        ON PRODUCT_PRICES
        FOR EACH ROW
    DECLARE
            v_min_price number;
            v_max_price number;
        BEGIN
            SELECT  MAX_PRICE,
                    MIN_PRICE
              INTO  v_min_price,
                    v_max_price
              FROM  PRICE_RANGE
              WHERE PRO_ID = :NEW.PRO_ID;
        IF NOT :NEW.PRICE BETWEEN v_min_price AND v_max_price
          THEN
            RAISE_APPLICATION_ERROR(-20002,'THE PRICE IS NOT IN THE RANGE FOR PRODUCT');
        END IF;
      EXCEPTION
        WHEN NO_DATA_FOUND THEN
          RAISE_APPLICATION_ERROR(-20001,'NO SUCH PRODUCT');
    END;
    
  • Delete the exception management

    Hi guys,.
    I have a problem in my procedure. There are 3 parameters that I'm passing in the procedure. I am corresponding to these parameters to those of the table to delete one record at a time.
    For example if I want to delete the record with the values (' '900682', 3, July 29, 2008 ') as parameters, it deletes the record of table, but still when I run it with the same parameters must show me an error message but it again says "deleted the request for transcript...". "Can you please help me with this?

    PROCEDURE p_delete_szptpsr_1 (p_shttran_id IN saturn.shttran.shttran_id%TYPE,
    p_shttran_seq_no IN saturn.shttran.shttran_seq_no%TYPE,
    p_shttran_request_date IN saturn.shttran.shttran_request_date%TYPE) IS

    BEGIN

    DELETE FROM saturn.shttran
    WHERE shttran.shttran_id = p_shttran_id
    and shttran.shttran_seq_no = p_shttran_seq_no
    and trunc (shttran_request_date) = trunc (p_shttran_request_date);
    DBMS_OUTPUT. Put_line (' removed the transcript request Seq No. (' | p_shttran_seq_no | student (' | p_shttran_id |') for the requested date (' | p_shttran_request_date |'))) ') ;
    COMMIT;

    EXCEPTION WHEN NO_DATA_FOUND THEN
    DBMS_OUTPUT. Put_line (' error: the Notre Dame provided = student ID (' | p_shttran_id |))
    ('), Transcript No Request = (' | p_shttran_seq_no |) ('), Ask Date = (' | p_shttran_request_date | not found.');

    END p_delete_szptpsr_1;


    I have a SELECT statement to use NO_DATA_FOUND?

    A DELETE statement that will remove any line (such as an UPDATE statement that updates no line) is not an Oracle error. Oracle throws no exceptions.

    If you want your code throws an exception, you will need to write this logic. You can throw an exception NO_DATA_FOUND yourself, i.e.

    IF( SQL%ROWCOUNT = 0 )
    THEN
      RAISE no_data_found;
    END IF;
    

    If you go just to catch the exception, however, you could just some embedded code you would use to handle the exception in your IF statement, i.e.

    IF( SQL%ROWCOUNT = 0 )
    THEN
      <>
    END IF;
    

    In your original code, your exception handler is just a statement of DBMS_OUTPUT. It is incredibly dangerous in real production code. You rely on the fact that the customer has allowed him to exit, that the customer has allocated a sufficient buffer, the user will see the message, and that the procedure will never be called to any piece of code that never worry if it succeeded or failed. There are very few situations where those who are sure of things to build on.

    Justin

Maybe you are looking for