call another proc and passing the values in the exception block

Hello
I'm trying to call the procedure another passing values in the exception block... but I couldn't m figure out how would the values in the exception block
create or replace procedure test_proc 
is 
   cursor test_cur is 
     select update_dt from test_tbl;   
     
     test_rec test_cur%rowtype;

    begin
        for test_rec in test_cur
        loop
            begin 
                insert into test_tbl values (test_rec.update_dt);
                commit;
                exception 
                   when others then
                     rollback;
                --      test_proc2(update_dt)       --     want to call another procedure and want to pass that update_dt here ; this process will insert the update_dt into the message table    
                   commit; 
                 
        end loop;  
        
    end;
     
 

My question is how do i pass value(update_dt) into the exception block or do i need to create any varaible ?? any idea 
Thank you very much!!

BTW, you can still use SQL % BULK_EXCEPTIONS even if you don't use EXCEPTION to LOG. You just can't use ORA-24381, since it will not be raised. Using SO many OTHER instead. And of course, there will be only one element in SQL % BULK_EXCEPTIONS:

SQL> CREATE TABLE emp_temp AS SELECT * FROM emp;

Table created.

SQL> DECLARE
  2     TYPE empno_tab IS TABLE OF emp.empno%TYPE;
  3     emp_sr empno_tab;
  4     errors NUMBER;
  5     dml_errors EXCEPTION;
  6     PRAGMA EXCEPTION_INIT(dml_errors, -24381);
  7  BEGIN
  8     SELECT empno BULK COLLECT INTO emp_sr FROM emp_temp;
  9       FORALL i IN emp_sr.FIRST..emp_sr.LAST --SAVE EXCEPTIONS
 10         UPDATE emp_temp SET job = job || '_SR'
 11            WHERE emp_sr(i) = emp_temp.empno;
 12  EXCEPTION
 13    WHEN OTHERS THEN -- Now we figure out what failed and why.
 14     errors := SQL%BULK_EXCEPTIONS.COUNT;
 15     DBMS_OUTPUT.PUT_LINE('Number of statements that failed: ' || errors);
 16     FOR i IN 1..errors LOOP
 17        DBMS_OUTPUT.PUT_LINE('Error #' || i || ' occurred during '||
 18           'iteration #' || SQL%BULK_EXCEPTIONS(i).ERROR_INDEX);
 19            DBMS_OUTPUT.PUT_LINE('Error message is ' ||
 20            SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE));
 21     END LOOP;
 22  END;
 23  /
Number of statements that failed: 1
Error #1 occurred during iteration #2
Error message is ORA-12899: value too large for column "SCOTT"."EMP_TEMP"."JOB"
(actual: 11, maximum: 9)

PL/SQL procedure successfully completed.

SQL> DROP TABLE emp_temp;

Table dropped.

SQL> 

SY.

Tags: Database

Similar Questions

  • How to call another page and pass the page parameter to another page?

    Hi friends,

    I've finished a page based on the payment date, he turns the payroll, summarized in the table region. Now, I have to address in detail (submit) button, when click on the details button I want to open the new page, this page based on a few VO. This vo I spend 2 parameters, we're Person_id, and the second is pay date until we are on the front page.
    How to achieve this where I can write code, I am new to the OPS. could you please explain in detail and process?
    Thank you and best regards.
    Jocelyne.

    RAMU

    The value of your hashmap returns null. Let intrepret your code below

    String newValue = params.get("pid").toString();
                               null.toString(); will always throw null pointer exception
    

    Robichaud, I suggest you to always put some SOPS for debugging purposes. It is useful to locate the problem.

    Kind regards
    GYAN

  • Call AJAX process and pass the value on request

    Hello
    I want to call a process on demand by a button. So I added the following for her javascript code:


    function update_bp1()
    {
    Alert ('hhhhi');
    Alert (document.getElementById('P11_PATIENTID').value);
    var ajaxRequest = new htmldb_Get (null, & APP_ID., 'APPLICATION_PROCESS is update_bp', 0);
    ajaxRequest.add ('patient_id1', document.getElementById('P11_PATIENTID').value);
    ajaxResult = ajaxRequest.get ();
    Alert (ajaxResult);
    }
    < /script >


    The called application process is:

    declare
    number of v_id;
    number of v_visitno;
    v_patientid varchar2 (10);
    BEGIN

    Select max (id), max (VISITNO)
    in v_id, v_visitno
    of TBL_PATIENT
    where PATIENTID =: patient_id1;

    Update TBL_PATIENT
    the SYSTOLIC value = 10,
    DIASTOLIC = 20
    where id = v_id
    and visitno = v_visitno
    and patientid =: patient_id1;

    commit;

    HTP. PRN ('process value'-|: patient_id1);

    end;

    It seems there is error in the ajaxrequest.add clause, as after commenting on the function is executed. Alert print correctly the value P11_PATIENTID.
    The alert of the ajaxresult gives the complete HTML code and the process is not running. How interpreet ajaxresult error.

    Please help me to identify the problem.

    Thank you

    Hello

    I think that it is not relative browser, but Firefox with the module Firebug is just a better tool for web developer.
    It is easier to debug problems you have now.

    Is the point of application patient_id1? You need also to pass the value to the application process?
    If you don't need it another vise, it is better to use variables global apex_application

    Try this
    JavaScript for HTML page header

    
    

    Then, create the new process On demand application named UPDATE_PATIENT. Please note that the name of this process is case sensitive.

    DECLARE
      v_id        NUMBER;
      v_visitno   NUMBER;
      v_patientid VARCHAR2(10);
      v_count     NUMBER;
    BEGIN
      SELECT MAX(id),
        MAX(visitno)
      INTO v_id,
        v_visitno
      FROM tbl_patient
      WHERE patientid = apex_application.g_x01
      ;
      UPDATE tbl_patient
      SET systolic  = 10,
        diastolic   = 20
      WHERE id      = v_id
      AND visitno   = v_visitno
      AND patientid = apex_application.g_x01
      ;
      v_count := SQL%ROWCOUNT;
      COMMIT;
      htp.prn(v_count || ' rows updated');
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
      htp.prn('error: patientid ' || apex_application.g_x01 || ' not exists in tbl_patient');
    WHEN OTHERS THEN
      htp.prn('error: ' || sqlerrm);
    END;
    

    Kind regards
    Jari

  • can I move my wnds 7 to another computer and use the same key

    can I move my wnds 7 to another computer and use the same key

    If the copy of Windows 7 comes with your computer, none.  Otherwise, Yes.

  • Still awaiting to hear from VMware after taking the training and pass the exam.

    Hello

    I took the training on February 1 (VMware vSphere: install, configure, manage) and passed the VCP - 410 exam on February 8, but have not yet heard of VMware.  :_|

    Is it normal that it takes a long time? I am supposed to receive an e-mail to confirm my VCP status, right?  ?:|

    Thank you.

    The status on the website of Pearson view should say that the review was a 'pass', you won't hear anything from VMware, until you receive your welcome kit VCP in post/mail and your Workstation 7 license by email - you should get those in the next 4-6 weeks... Bravo

    Scott.

    -

  • Once an unapproved site is added as an exception, how can I go back and delete the exception later?

    Once an unapproved site is added as an exception, how can I go back and delete the exception later?

    Thank you, Jefferson. You addressed the issue beautifully and delightfully complete.

    I found and deleted the server where I got the exception.

    "In the future, I suggest, by making an Exception, uncheck the box that adds a permanent exception. In this way, when you exit Firefox, the exception is removed automatically. »

    AHA. It's very good to know. I missed it when granting the exception today.

    The exception I gave (and now deleted) today wasn't really a risky site. I know the owner. Just a little problem in their relationship.

    Thanks again. And thanks Toddy... I did not say clearly what type of exception.

  • How to manage the plsql error occurring in the exception block

    We know how to manage exceptins located in the BEGIN block.
    But I am unable to catch the exception in the exception block. Write an erroeneous code so that the control will go to the exception block and there is also a plsql error, but I am unable to handle that error, it returns the error to the calling environment.

    DECLARE
    CNT NUMBER (5): = 0;

    BEGIN

    Select "Chris" IN double's NTC;
    DBMS_OUTPUT. Put_line (to_char (CNT));

    EXCEPTION
    WHEN invalid_number CAN
    DBMS_OUTPUT. Put_line (' error occurred inside the start block ');

    CNT: = "deba";

    WHILE OTHERS THEN
    DBMS_OUTPUT. Put_line (' error occurred inside the start block ');

    END;

    Please suggest me how to catch this exception?

    Hello

    DECLARE
    CNT NUMBER (5): = 0;

    BEGIN

    Select "Chris" IN double's NTC;
    DBMS_OUTPUT. Put_line (to_char (CNT));

    EXCEPTION
    WHEN invalid_number CAN
    DBMS_OUTPUT. Put_line (' error occurred inside the start block ');

    CNT: = "deba";

    WHILE OTHERS THEN
    DBMS_OUTPUT. Put_line (' error occurred inside the start block ');

    END;

    First of all your exception mouhamadou who you have sent i.e. invalid_number itself does not.
    You should use named exception VALUE_ERROR to catch 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 doubts regarding catch the exception in the exception block, you can run as below, by nesting a block Begin in 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 question is clear.
    :)
    Twinkle

  • Procedure that calls another proc throws the error message

    I have a proc returns ref cursor as below

    create or replace

    PROCEDURE PROC_RETURN_CV (P_in_deptno number, varchar2, p_out_info to sys_refcursor p_in_job)

    is

    Start

    Open p_out_info for ' select ename, empno from emp1 where deptno =: = deptno and job: job ' using p_in_deptno, p_in_job;

    end;

    /

    Another Proc calls over proc;

    create or replace

    procedure proc_call_cv is

    v_local_cv sys_refcursor;

    v_rec emp % roWtype;

    Start

    PROC_RETURN_CV(10,'CLERK',v_local_cv);

    LOOP

    SEEK v_local_cv INTO v_rec;

    EXIT WHEN v_local_cv % NOTFOUND;

    DBMS_OUTPUT. PUT_LINE ('EMPNO' | v_rec.empno);

    END LOOP;

    END;

    /

    But when I realize the proc that called the first proc returns error, below

    BEGIN

    PROC_CALL_CV();

    END;

    ORA-01007: variable not in select list

    ORA-06512: at "SCOTT. PROC_CALL_CV', line 7

    ORA-06512: at line 2

    01007 00000 - "variable not in select list.

    Can someone correct me?

    Thank you

    Ann

    You said that the return type is an emp % rowtype - the entire line - all columns

    You return all the columns in the select.

    Either refund * or set a record type

  • [ADF, JDev12.1.3] Lined back workflow a lot of values used as a dialog box. How to specify and pass the values to the btf appellant?

    Hallo,

    I've created a workflow bounded (containing JSPX pages) that I use as dialog box.

    There a lot of return values...

    I would like to how to go and read all values ret in the workflow limited appeal because the return value of dialogue seems to not allow a value...

    Thank you

    Federico

    You can try with returnListener, then to returnEvent.getReturnParameters ( https://myfaces.apache.org/trinidad/trinidad-api/apidocs/org/apache/myfaces/trinidad/event/ReturnEvent.html#getReturnParameters%28%29 )

    Dario

  • Make an express airport only connect to an another AE and not the main Time Capsule.

    Hi all

    I have a Time Capsule airport and 2 Airport Express. The Capsule is far and an of the expressed airport is in the middle (call this) 1 and the other far from it, I'm calling this 2. As it is now, the 2nd Airport Express terminal connects to Time Capsule. However, it gives me much lower speed (Interruptions during the game). But if the 2nd Airport Express connects to the AE first, which is the extension of the network of transport CANADA, significantly improves the speed.

    I've tried everything. All devices are relatively new (think of the last model). I called the Apple Support, but their solution was to any wire. I asked if the 2nd AE can be configured statically, but they have quoted me their policy, which is not supported and took my info and never called back. I read the posts of the forum, but could not find any relevant information.

    Can someone tell me how I can do the 2nd AE connect only to the AE 1 (in the middle) so I can get faster speed for the game device wired to the 2nd AE? Your feedback is much appreciated.

    Kind regards

    B.

    When you try to extend using the wireless, there will be a loss of speed associated with the process.

    When the two Airport Express connect to Time Capsule, it will be more loss of speed because the 2 devices are connecting and extending.

    If the 2nd Airport Express does not connect to... Time Capsule and it connect instead to the 1st AirPort Express... then 2nd Terminal AirPort Express doesn't have to extend the network.  The 2nd Airport Express could be used for AirPlay, or to connect to a remote printer on the USB port, but it cannot 'expand' or 'repeat' in this case the signal of the wireless network.

    So you're wrong bing into thinking that the network is the extension more quickly if the 2nd Express connects to the 1st. Your network will behave at the faster speed even if you just turn off the 2nd Express.  It is not at all in any case extending the network, and you don't need.

    Here's another way to look at the same thing... using an illustration of the Apple support document for the extension of a network:

    IF... you can connect the 1st Terminal AirPort Express at the time using an Ethernet cable Capsule... then... the 2nd Airport Express would extend the signal from the first... but speed would be because you are trying to extend using the wireless.

    SO... connect the AirPort Express devices using Ethernet... then you will have maximum coverage at the highest speed... Since there is no loss of signal via the Ethernet cable.

  • VCS - CPL to block call routing to and from the same area of neighbor

    Hi all

    Is there a CPL rule that can be written to block calls from a neighbouring area to the same area of neighbor?

    We have problems with CUCM sent appeals to the our VCS VCS then routes the call return CUCM, causing thus "too many jumps."

    In the example

    MOVI user control VCS try to compose endpoint registered RTC CUCM, but incorrectly dials

    Appeal does not have to search for the terms of local area

    Call does not match search for VCS Expressway rules

    Call corresponds to captures all of CUCM (. *) @domain.com

    CUCM does not form DN or URI for the wrong phone number and the call is routed to the VCS control due to the SIP routing model of *. * on CUCM

    We have to capture all CUCM at the end, since we offer PSTN, as well as our users and phones have the alphanumeric URIs assigned to the DNs for Jabber, etc.

    I fear that he is not really an easy way to do it, I know because the call charged CPL first, CPL don't know what area it was intended for.

    It's probably more easily accomomplished with a slight modification to your rules of research rather than spraying anthing "@domaine" everywhere - something like:

    Anything incoming directly at @domaine in the nearby area of the local area (as is inside your organization, such as if the CUCM not found and sent it to the VCS he won't be on the CUCM, so must be local (or nonexistent) - and stop.

    And the opposite of the above - route whatever it is for @domaine of the localZone.GetDaylightChanges (because it was not found locally) to stop and the CUCM neighbour-

    And do similar for what is coming from other areas outside to route to wheverver that will be endpoints.  In this way, your call should not be bouncing back between the CUCM and VCS and create the loop that you are currently experiencing.

    Of course, if your environmetn is a little more complex than the simple CUCM and VCSes, this can be a bit oversimiplified, but could lead you in the right direction.

    Another thing to consider too - if you put in your endpoints in a directory, users can use - that will help you to prevent wrong type stuff :)

    Wayne
    --
    Remember the frequency responses and mark your question as answered as appropriate.

  • Can I move my Vista license to another machine and remove the original?

    New operating system installed, same key, different Machine

    I currently have Vista running on my laptop but I'm the upgrade/transition to a desktop computer. I plan also scratching my laptop / Linux loading it and wait for the computer to finally die. Can I install Vista on my new desktop PC and use the product key, I used for my laptop to Vista installation? If Yes, where can I find the key?

    Edit: The laptop came with XP and I've upgraded to Vista

    Hello

    The retail license can be transferred to another machine

    but you have a problem that you only have a license to upgrade to vista

    you need an operating system that is installed to upgrade

    If you have received the upgrade to vista from your manufacturer of computers as part of the purchase transaction, it is related to the original computer

  • Redirect to another page and hide the buttons

    Hello

    It is possibel to hide the buttons if I redirect on one page?

    Example:

    To Page 2, there is the 'Page 3' button. If someone clicks on the button will open the page 3.

    In Page 3, there are three buttons 'A', 'B' and 'C '.

    If I start on page 2 and change the site to click on the button 'Page 3' keys 'A' and 'B' will be hiding on page 3.

    If I start to on page 2 and the change of the site using the menu navigation on page three, all buttons will show up on this site.

    Workspace: TEST_OA5
    Username: [email protected]

    password: Hund456 (<-new password)

    Can someone help me?

    THX

    René

    RWErene81 wrote:

    It is possibel to hide the buttons if I redirect on one page?

    Example:

    To Page 2, there is the 'Page 3' button. If someone clicks on the button will open the page 3.

    In Page 3, there are three buttons 'A', 'B' and 'C '.

    If I start on page 2 and change the site to click on the button 'Page 3' keys 'A' and 'B' will be hiding on page 3.

    If I start on page 2 and change the site using the menu navigation on page three, all buttons will be displayed on this site.

    Add a value ask as PAGE_2_BUTTON for the button on page 2, and then make the buttons A and B on page 3, conditionally to aid a ask! = Expression 1 condition, with term 1 on PAGE_2_BUTTON.

  • reset of movieclip between levels and passing the required variables

    Hello

    I am currently working on my first flash game and were able to get close enough everything works...

    I can play individually at each level by manually changing the variable "level =" (at any level I want to play) in actionscript code...

    Now I need to find the right way to reset the movie after each level, but still pass the variable Timer "currentTime" and "level"...

    Is there a usual way to do this?

    Can I use the variables I saved in the init() function...

    I really hope someone can help I'm so close being completed...

    Use the trace() function to debug your problems.  What is the next show:

    If ((level == 71) & (gamePage.a1.hitTestObject (gamePage.h1) & gamePage.h1.occupied == true) {})

    spinSpinner();

    Level = 1;

    trace (mainTimer);

    mainTimer.reset ();

    mainTimer.start ();

    removeChildAt (0);

    addChildAt (completePage, 0);

    } else {}

    gamePage.helpIcons.gotoAndStop ('icon7');

    }

  • Firefox stop working and I can't even open the profile page to create another profile and start the migration to a new profile, what to do now?

    I can't get firefox to respond - even to open. I tried the suggestion of support for the creation of a new profile, but the instructions are not working anymore so I can't create a new profile and test the system. I don't want to lose my info saved thanks to a re - install if I'm not even sure that it will work - if the data is corrupted. whatever that means.

    At a stand still...

    BTW - since I have to use IE even access this info I can't find the troubleshooting information below. It gets ridiculously more complicated that I never wanted him.

    Some Firefox problems can be solved by performing a clean reinstall. This means that you remove Firefox program files, and then reinstall Firefox and won't lose bookmarks and history. Please follow these steps:

    1. Download the latest version of Firefox from http://www.mozilla.org office and save the installer to your computer.
    2. Once the download is complete, close all Firefox Windows (click on quit in the file menu or Firefox).
    3. Remove the Firefox installation folder, which is located in one of these locations, by default:
      • Windows:

        • C:\Program Files\Mozilla Firefox
        • C:\Program Files (x 86) \Mozilla Firefox
      • Mac: Delete Firefox in the Applications folder.
      • Linux: If you have installed Firefox with the distribution-based package manager, you must use the same way to uninstall: see Install Firefox on Linux. If you have downloaded and installed the binary package from the Firefox download page, simply remove the folder firefox in your home directory.
    4. Now, go ahead and reinstall Firefox:
      1. Double-click on the downloaded Setup file and go through the steps in the installation wizard.
      2. Once the wizard is completed, click to open Firefox directly after clicking the Finish button.

    Please report back to see if this helped you!

Maybe you are looking for