the exception in the procedure call management

Hello

I have a package where currently make phone calls to private public process procedures.

and the senario is: -.

create package body p_tst
is

ex_failed exception;

-It's private proc
procedure p_private
is
Start
.
.
raise ex_failed;
exception
When ex_failed
then
lift;
.........
end p_private;

procedure p_public
is
Start
....
-nomaking appeal to the private sector
-procedure
p_private;

-Here, I need to catch
-the exception thrown
-past of callee
-procedure
When ex_failed
...
end p_public;

end;

Basically, I want to catch any exception of procedure called passed to the procedure call and raise the same exception by calling procedure.

is it possible to intercept the exception even in the calling procedure?

Yes, p_private throws the exception, it will be taken by p_public and the program stops after dbms_output.

Tags: Database

Similar Questions

  • imitate the situation when the procedure call fails

    Hi all

    My need is to emulate the situation when the procedure call fails and I have an exception.
    How can I make it?

    You can use, RAISE_APPLICATION_ERROR to raise a custom exception, or you can create a situation where an exception will be raised-for example inserting duplicate data in a table with a uniqueness constraint, inserting data with an invalid foreign key, taking a tablespace offline, using too many characters in a string assignment... the list is long.

    Published by: Bravid on August 12, 2011 08:37
    typo

  • The procedure call?

    Hello
    That's what I try to do, if you have some context to my problem.

    1. I'm putting some details for a command in a rowtype variable.
    2. I then tries to call a procedure that inserts data in providing this rowtype as a parameter variable.


    My code:

    DECLARE
    order_info mytable % rowtype;
    BEGIN
    order_info.ID: = '1';
    order_info. Name: = "lollipops".
    END;
    /

    create or replace procedure orderinsert (order_info in mytable % rowtype)
    AS
    BEGIN
    INSERT INTO mytable
    values order_info;
    END;
    /





    How do I get this to actually change the fact table? I'm on track for what I'm doing?

    Thank you

    >
    OK sorry I didn't know that he could compile and still be wrong.
    >
    What are you talking about? There's NOTHING wrong with the code of procedure you have posted.

    And there is nothing of syntactically wrong with the code of the anonymous block that you posted. The only thing missing, it's that you NEVER called the procedure.
    >
    Especially because the way that I am asked to do is... I guess that weird because there are easier ways to accomplish the task.
    >
    Yet, what are you talking about? What, exactly, is asked to do?
    >
    So in PL/SQL, you can use SQL, but you cannot combine elements of SQL and PL/SQL in the same statement, they stay separate?
    >
    What do you mean by any of this? Please explain.
    >
    I'm at least correct in declaring the rowtype first, then by assigning values to the columns, then by calling the procedure that the data will be transmitted via the parameter 'in '? Or is there a better way / okay to do that?
    >
    Never I demonstrated just to you when I added the procedure call to the anonymous block that you created?
    >
    If that is correct then I need to just find a way to put these data in the table of my database
    >
    Please explain. The procedure will be "put this data in the table" in your database.

    Almost nothing of what you say in this last answer makes no sense. What, exactly, you try to do?

  • the procedure call in the other schema with credentials of this scheme

    Hi, experts.

    I have this problem. I need to call a procedure of WORKSPACEOWNER1 schema SCHEMA1, but I need to do this as SCHEMA1 was WORKSPACEOWNER1.

    This is the procedure:

    CREATE OR REPLACE procedure WORKSPACEOWNER1.Test_stop_process is
    workspace varchar2(500);
    begin
    
    owbsys.wb_rt_script_util.set_workspace('WORKSPACE1');
    owbsys.wb_rt_script_util.deactivate_all();  
    end;
    

    Now, if I call the WORKSPACEOWNER1 procedure is not problem, but when I call to SCHEMA1

    begin
    workspaceowner1.test_stop_process;
    end;
    

    Throw this error:

    ORA-20008: the workspace with the name: WORKSPACE1 and owner: SCHEMA1 does not exist.

    You can find out the information of existing workspace from the ALL_IV_WORKSPACE view or view WORKSPACE_ASSIGNMENT.

    ORA-06512: at "OWBSYS. WB_WORKSPACE_MANAGEMENT', line 1602

    This is because WORKSPACE1 exist for WORKSPACEOWNER1 not for SCHEMA1.

    Is this possible?

    Thanks in advance.

    Concerning

    Hi, Ana GH.

    Thanks for the reply.

    I checked in Gobals and safety, and Yes, SCHEMA1 is registered as a user of WORKSPACE1.

    Finally, I can solve the problem using DBLinks. Looks like dblink executes the procedure next to WORKSPACEOWNER1.

    I have create a DBLink as:

    CREATE the LINK of DATABASE link_wks CONNECT TO workspaceowner1 IDENTIFIED BY pass USING "orcl".

    Then this:

    BEGIN

    WORKSPACEOWNER1. Test_stop_process@link_wks;

    END;

    Works.

    Thanks to you all. I learned a lot.

    Concerning

  • How to find the name of the procedure call or a package?

    Hi all..

    Is it possible to find the name of the procedure or the calling package?

    I mean.. If proc_1 calls proc_2 how can I find in proc_2 proc_1 call?

    Proc_2 is called from a different procedure? I need to write to the size of the code that should fire depends on the Proc he calls?

    Please help me solve this problem.

    Thank you

    You could try OWA_UTIL. WHO_CALLED_ME
    "This procedure returns information (in the form of output parameters) on the unity of PL/SQL code that called it."
    See:
    http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14258/w_util.htm#sthref11492

  • Function in the procedure call

    Hi team

    I have a question, if I create function inthat I create procedure then how to call the procedure only please give little example

    Thank you

    Hello

    Here is a little example:

    SQL> set serverout on
    SQL> create or replace function test
      2  return varchar2
      3  as
      4    my_var varchar2(4);
      5   --
      6    procedure my_proc
      7    is
      8    begin
      9       dbms_output.put_line('Hello World');
     10    end my_proc;
     11  begin
     12     my_proc;
     13     my_var := 'Done';
     14  return my_var;
     15  end;
     16  /
    
    Function created.
    
    Elapsed: 00:00:00.01
    SQL> select test from dual;
    
    TEST
    ----------------------------------------------------------------------------------------------------
    Done
    
    1 row selected.
    
    Hello World
    Elapsed: 00:00:00.04
    
  • make sure that the procedure, called pl/sql from apex DURATION

    Hi gang,.

    I was wondering what the thoughts of the people where assuring him a packaged procedure is called in a session of runtime Apex, as opposed to sql * more or elsewhere.

    For example, how apex_mail.send to validate and output the following if executed from sql * more:
    ORA-20001: this procedure must be called from a session of the application.

    A simple call to check v ('APP_USER') wouldn't is not null enough?

    See you soon,.

    ScottWE

    Hello

    I think you could use the APEX_CUSTOM_AUTH.IS_SESSION_VALID function
    http://download.Oracle.com/docs/CD/E14373_01/apirefs.32/e13369/apex_auth.htm#BABHDFII

    Example of

    CREATE OR REPLACE PROCEDURE my_procedure(p_poaram1 VARCHAR2)
    AS
    BEGIN
    IF APEX_CUSTOM_AUTH.IS_SESSION_VALID THEN
     -- do stuff here when session is valid
    
    ELSE
     raise_application_error(20001,'Session is not valid');
    END;
    

    BR, Jari

  • When I open "Devices and printers" and click on a printer, there is no button at the top called 'manage default printers '.

    I'm changing my default printer depending on my network, but the button is simply not there.  I open "devices and printers.  Yes, I clicked on a printer.  These are the options that I get: adding a device; Add a printer; See what's printing; The print server properties; Remove the device.  There is no more options arrow.  What I am doing wrong?

    See if this will help

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-hardware/manage-default-printers-button-missing/cf2453c6-b47e-4DA8-82c5-e9c7246b277a

  • How the procedure call stored procedure Store and no need to wait for the answer?

    There are two store procedure, sp1 and sp2, sp1 include sp2.


    If I have that sp1call but sp1 sp2 don't neet to wait the response of sp2, sp1 sp2 simply start and countinue to run the following command.

    How do I do?

    submit a job (DBMS_JOB) which sp2 excecutes in an autonomous transaction (which starts the task immediately)

  • ORA-06508, procedure cannot call the procedure of package

    I have a large stored procedure that calls a package (procedure) that manages a number of procedures to determine whether the process can continue or not.  (It checks authorization of the student to enroll in a class).  We have a web process calling the stored procedure, and that works fine.  What does not work, is a call to the package.  Oracle returned ORA-06508: PL? SQL: could not find program unit called.

    I have included instructions for debugging, so I know that it is the specific call to a procedure in the package fails with ORA-06508.  Thinking it's perhaps something in the package, I inserted a debug statement as the first line in the procedure called in the package.    (Debugging instructions call a procedure inserts of rows in a table of debugging with independent validation).

    When I log in the user account with sqlplus and run a test, everything works fine.  But when the web process is running under the same user, the process fails to call the procedure of package and fails with ORA-06508.

    It seems as if the web process runs with the rights of the appellant, or a role is not granted.

    Can someone help me understand what the problem is?

    offered hv, I appreciate your comments.

    We solved the problem: remove the package that couldn't be cited, then re-create.   That's all!

    Apparently, something in the database was tangled upward.   The server recently had problems with disk space, then it might have been related to that.  But we'll never know for sure.

    The stored procedure and packaging (procedures) which he called were owned by the same schema, and there is no mechanism that I can find to prevent one of the other appellant.  But that was the case - Oracle threw the ORA-06508 exception when the stored procedure called the package procedure.

    I replaced the stored procedure and package several times fine-tuning debugging code, but this has not fixed the problem.

    Finally let it drop and then re-create the package, it's which solved the problem.

    Regarding requests to view the code, there is no way that I could reproduce the problem, since the error that occurred was against the permissions and rules which packages run and the procedures of the Oracle.  Thanks for all the tips and suggestions.

  • procedure call with sys_refcursor as a parameter in the procedure

    Hello
    I tried the following procedure after sys_refcursor as parameter of a procedure,
    And confused about the procedure call
    CREATE OR REPLACE PROCEDURE test_ref (emp_cur IN sys_refcursor) IS
    emp_rec Z_emp%ROWTYPE;
    BEGIN
    LOOP
    FETCH emp_cur INTO emp_rec;
    EXIT WHEN emp_cur%NOTFOUND;
    dbms_output.put_line(emp_rec.ename ||' is a ' || emp_rec.job);
    END LOOP;
    END;
    How can I call the above procedure to get the data

    Thank you

    You must declare a variable sys_refcursor and open it with the necessary query and then pass that variable as a parameter to your procedure.

    Something like that.

    set serveroutput on
    
    declare
      my_cursor sys_refcursor;
    begin
      open my_cursor for select * from employee;
      test_ref (my_cursor);
    end;
    /
    
  • insufficient privileges when you create sequence using the procedure

    CREATE OR REPLACE PROCEDURE schema1.proc1 AS
    BEGIN
    EXECUTE IMMEDIATE 'DROP SEQUENCE schema1.add_ins_seq';
    EXECUTE IMMEDIATE 'CREATE SEQUENCE schema1.add_ins_seq MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 1000 NOORDER  NOCYCLE';
    END;
    

    This procedure is created to schema1 by schema1.

    Schema1 boasts a CREATE SEQUENCE privilege.

    When I run this procedure through SQL Developer after the Cup to schema1, the error is thrown in insufficient privilege to CREATE SEQUENCE, however, DROP SEQUENCE is executed. I can create the sequence without the procedure call.

    If I add AUTHID CURRENT_USER so I don't get the error of insufficient privileges.

    Why it gives this error when the owner and the applicant of the procedure is schema1?

    Hello

    1st thing to know: when a procedure is defined (and updated), any privileges granted through ROLE is not taken into account. This is because these privileges can be active or not at the level of the session (as happens if for example a user has active 'role A' in session 1 but not in session 2 and if this role has been used to define a procedure?) The proecedure must at the same time be VALID in session 1 and INVALID session 2? Is not possible.

    Thus, for instance in a situation of 'standard': user SYSTEM has 'DBA Rôle', so you can for example make a sqlplus session "SELECT * v $ instance;", but you would write a procedure owned by system making instance_name SELECT INTO l_variable OF v$ instance;  "then"surprise": the procedure cannot be compiled because of the ORA-904 Table or view does not exist..." To be able to create the procedure, a DSS system needs to be done.

    2nd thing for your special case, a little more complex: default for a procedure is 'AUTHID DEFINE', but once more: it means "privileges of the author creating the procedure", so without taking into account the acquired privileges through roles... Your user name is 'sequence create' through a role, it cannot use the privilege within the procedure.  But... but when you define the procedure with AUTHID CURRENT_USER, privileges are evaluated at run time, and thanks to the active ROLE in the session by calling the procedure, at this time, the user can create the sequence.  If try again you but with 'The VALUE NONE ROLE' in the session before the call, you will again have the question.

    Conclusion: If you need to do the action, you must grant the user the necessary privilege directly.

    Best regards

    Bruno Vroman.

  • Issue of call manager

    We have a Manager call we use for AA to provide wishes and staff of mailbox access mailbox option and no DDI extension before you send us the receptionist (Call Manager driver Point to the monitoring console). Greeting for office hours and the other for off hours which takes messages.

    We had a request to remove greeting during the hours of office, so the rings call the pilot immediately Point, but always need wishes and message opting for hours.

    I have change the standard greeting of the current record to empty and the option after the salutation is to attempt to transfer to Pilot Point. This kind of work, but I get the system prompt to 'wait while I transfer your call', then a second or two from the Department of health before the Pilot Point rings.

    Any way I can stop the system prompt and the Ministry of health before the transfer so that the caller hears only ringtone? Here's how incoming call:

    RTC Via GW-> CTI Route Point-> Unit-> CM Point of pilot-> Attendant Console user

    TIA

    D

    Check out this thread for more information on how to replace the system with a white prompt we so used to hear you it any longer:

    http://forums.Cisco.com/eForum/servlet/NetProf?page=NetProf&type=bookmarks&CommCmd=MB%3Fcmd%3Dpass_through%26location%3Doutline%40%5E1%40.ee8253b/1#selected_message

    do not forget that it is not taken in charge of TAC, and the change will be deleted when you upgrade so you don't have to remember to reapply after.

    Not that you can do on the Department of HEALTH it - it is paid by the switch, not the unit.

  • What is the procedure of upgrading since version 7.1 of CUCM (MCS Server) call manager to version 10.2 of CUCM (on the server of the UCS)

    Hello

    What is the procedure to upgrade the call manager since version 7.1 of CUCM (MCS Server) to version 10.2 of CUCM (on the server of the UCS), please let me know the steps to what would be the backup procedures and upgrades.

    Concerning

    Gerard

    I suggest reading this guide to make sure that you have prepared your environment to support the first 10.x. The link below also contains the path to upgrade to 10.0 (1).

    One of the ways to do this is:

    1 / apply cooling cop upgrade file on all servers in the cluster.

    2 / upgrade the cluster to 8.6 (2). Make a backup of the cluster.

    3 / build a cluster of servers 8.6 (2) on the virtual machines and assign them the same host name and the IP address of the cluster hardware. (You may need to keep these on a separate network until turn off hardware machines)

    4 / restoration of the backup of the pile of material on the VM cluster.

    5 / upgrade cluster VM to 10.0 (1).

    http://www.Cisco.com/c/en/us/TD/docs/voice_ip_comm/CUCM/upgrade/10_0_1/C...

  • 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

Maybe you are looking for

  • How can I get the Russians out of my iphone?

    Hi guys, I have been using iphone for about 6 years now and never noticed anything unusual with my accounts. Yesterday, I bought a brand new SE iphone. I was put in place thanks to icloud backup that I can get all the previous of my old phone setting

  • ReachIt: Connections of Cloud gone

    Hello! Since yesterday, reachit does not show cloud storage, I added, and I can't add a new cloud storage. If I try to add a new connection of cloud, the dialog box opens but shows no connection of cloud to select. Link to photo/image Mod comment: Ov

  • Just black and white picture on television when connecting my A100 Sat

    I plug in my TV (it's an old model) to my laptop (satellite a100-529) and everything is perfect, but the picture on the TV have no color.Where is the problem and how can I solve it?

  • Right-click Office

    I'm not able to access infromation properties to change the settings for the desktop by right-clicking on the desktop.  The box, but when I click Properties, the computer freezes and must be turned off manually.  I recently had a new hard drive insta

  • Configuration of webcam

    Someone knows how to fix a side by side configuration of the laptop webcam on HP laptop computer computer 2000?  I'm trying to use my cam to take pictures and I get an error message that says: "the Application failed to start because its side by side