HO to handle errors in procedures or the my caller PKG

Dear all
I have a small doubt...
How can I handle errors in my appeal procedure or PKG?
Means:-J' have a procedure as follows: -.
Create or replace procedure P1( iempno number,oname out Varchar2)
IS
Begin 
 Select empname into oname }
 From emp 
Where empno = iempno ;
Exception 
 When no_data_found then
  Dbms_output,put_line (SQLCODE||’-‘||SQLERRM);
END;
IF I call this in my PACKAGE so how to catch this error in my package? I mean if errors happens here in this procedure, then it should disply when I will exercise the PKG.
So what I did is right or not?

And in the same way, I have a PKG. I call this PKG in my trigger of FORM button press...
SO for the exception what should I write?
Let's say in my package, I have a proc and ther that I wanted to write when no. _data found so...
Dbms_output, put_line (SQLCODE |) » -‘|| SQLERRM);
Raise_application_error ("-20000', 'ABC'");

Which is correct?

Kindly guide me how handle errors by calling pkg proc or functions...

Published by: LuKKa on October 7, 2010 11:02

Hello
You will need to use RAISE_APPLICATION_ERROR if you want to view the message in your form by the package/procedure/function of the database.

Error in your procedure/package/service write the statement as below...

RAISE_APPLICATION_ERROR('-20000','Error Message Goes Here...');

Now in the form create trigger on called-ERROR at the level of the form, and view the message using the variables DBMS_ERROR_CODE and DBMS_ERROR_TEXT.

-Clément

Tags: Oracle Development

Similar Questions

  • Error when painting during the AJAX call page fault

    Hi all

    I do a simple AJAX call test with the emp table. In my page, I have a report, a search box and a button. You put in a text and click search and you will get the result that all the works.

    I have a requirement where if you click on the button and there is no search match you will be redirected to another page, just reload the report to display the result as usual.

    So, I took the road to AJAX where I perform a simultaneous when the user enters a text search and click on the button. If the search count (*) > 0 then return return County else returns 0.

    The code for the application process is:
    DECLARE
    begin
    CCOUNT number;
    
    
    
    begin
    Select count(*) into ccount 
    from emp
    WHERE 
    UPPER(:F_SEARCH_RESULT) like '%'||upper(ename)||'%';
    
    exception when no_data_found then
    htp.p(0);
    end;
    
    htp.p(ccount);
    
    
    END;
    My (still working on that) Java script code is:
    <script language="JavaScript" type="text/javascript">
    
    
         function search_count()
    
         var get = new htmldb_Get(null,null,'APPLICATION_PROCESS=SEARCH',0);
         get.add('F_SEARCH_RESULT', $v('P1_ENAME'));
         var gReturn = get.get();     
         console.log(gReturn);
    
         var gReturn_sanitised = praseFloat(gReturn);
              if (gReturn_sanitised == 1)
              doSubmit('SUBMIT');
         
              
    </script>
    I tested this code in Firebug, and when I do a console.log (gReturn) on the release of the AJax call I get this error that prevents me from dealing with the result of gReturn and be done with the code. The error looks like:
    <html><body>
    <h1>Error occurred while painting error page: ORA-01403: no data found</h1>
    </body></html>
    I tried adding exception when no_data_found but without success. Still get the same error. My version of the APEX is 4.2, any suggestion welcome. See you soon.

    Xrc xarg wrote:
    Still no luck, even if I'm doing a simple:

    begin
    htp.p('0');
    end;
    

    in the process of the page, I get the same error as before.

    I've done much AJAX call like this before elsewhere and can't for the life of find me whats wrong here.

    I have reproduced the issue in apex.oracle.com

    WORKSPACE: AIWORSKSPACE
    USER: TEST
    PASSWORD: test
    APP #: 69721
    Page: 1

    The point of application of F_SEARCH_RESULT had the security setting of default Session State Protection of Restricted - can not be set to the browser. Change this Unrestricted.

  • Error-2625 cannot write the file call node in NI_XML.lvlib:Save.vi

    I get this error when you perform a certain acquisition with a CoolSnap HQ2. The user defines its parameters, then these settings are saved in the file so that they can be easily identified later in the database. The error came to us when we did a test with 4 different parameters. We did: Laser X w / filter X; Laser X w / filter Y. Laser Y w / filter X; Laser Y w / filter Y.

    The first and the third is saved without errors, but the second and fourth receive errors.

    Error-2625 cannot write file call node in NI_XML.lvlibave.vi

    Someone has an idea, what happens? This is the vi I'm talking about.

    I forgot to mention that the name of filter attribute is 593/LP, could the "/" be the cause?

    Found the solution. It is indeed the "/" in the name of the filter that caused the problem. I replaced it with a '-' and everything worked

  • Error Msg received on the tab open: Exc in ev handl: error: Bad NPObject as private data!

    Very simple - the following error message appears when I open a new tab with a web page or empty:
    EXC in ev handl: error: Bad NPObject as private data!

    Please see the solution in http://kb.mozillazine.org/Problematic_extensions
    "McAfee Site Advisor.

    (Windows): for best results, you need to uninstall McAfee Site Advisor from Control Panel > add/edit programs (programs and features). Restart the system. Then http://www.siteadvisor.com/ reinstalling and reboot the system. Installation of other waste (crapware) suggested applications.

    Please mark "resolved" a response that will better help others with a similar problem - hope it was her.

  • I get the context menu after using firfox as my browser: Exc in ev handl: error: Bad NPObject as private data!

    In the last few days I've been doing the following popup when I use firefox as my browser: Exc in ev handl: error: Bad NPObject as private data!

    I guess it comes from your last update. I have windows vista with a 64-bit processor, and I use the latest version of firefox. I checked to see if I was getting the same error message with explore and I'm not. It seems to be some sort of conflict with java script. This can be corrected?

    You have to remove and re - install anything. I had the same problem and simply disabled the McAfee Siteadvisor module without deleting. I then restarted Firefox and the problem was solved.

    But here's the important part: I reactivated the add-on and then restarted Firefox twice. The problem is not returned!

    Just so disable, reboot, re-enable and restart. It worked for me!

  • Satellite A100-153: Error Message appears during the recovery procedure

    Hello
    Please help me!

    I tried to recover my laptop with my original Toshiba recovery cd, but decompression 14% I got an error.., named:
    Windows - delayed write failed
    Windows was unable to save all the data for the file\Device\Harddisk\volume2\I386\OEMBIOS. Bl_. The data has been lost.
    This error can be caused by a failure of your computer hardware connection or a network. Please try to save this file elsewhere.

    So I don't know what to do...
    Is the problem that my hard drive is broken? but I don't think, because when I install with Windows XP Home Edition OEM I come up to 91% and then comes another error :((

    Please help me, anyone know what I can do?

    Please answer quickly... I need my phone tomorrow :*(

    Welcome, Tobias Erdmann

    Hello

    I guess you have you used original restore CD that was shipped with this laptop. That's why I put t thinks it is a CD problem but maybe with your HARD drive.
    Have you tried to format the whole HARD drive? Delete all partitions and format the HARD drive before installation

    If the OS install will not work or will divide in the middle of the procedure, then the material should be checked. The A100 is not very old unit and therefore the guarantee must be valid. If a new HARD drive is necessary you should get it for free.

    Good luck and please post if you know more details

  • error code: win32 error code returned by the print processor: 6. the handle is not valid.

    When I try to print to a network printer, the print job does not print anI getting the error code: win32 error code returned by the print processor: 6. the handle is not valid. All ideas

    Hello

    In this case seems to be with the corrupted printer drivers.

    Follow the steps below to reinstall the driver.

    1. click on the "Start" button, type PRINTERS in the start search box and press ENTER.

    2. find the icons that are associated with the printer, and then remove them.

    3. right click on the blank part of the window and choose "Run as Administrator"-> "Server Properties".

    4. on the tab drivers, select the printer listed and click Remove. Please, select Remove driver and driver package.

    5. open the start menu, enter APPWIZ. CPL in the search box and press ENTER to launch the "programs and features".

    6. try to remove all related printer software.

    7. then download the latest driver from the printer manufacturer's Web site.

    8 install the driver.

    All the best!

  • Re: "insufficient privileges" error when you run the Java stored procedure in another schema

    I get an "insufficient privileges" error when you run the Java stored procedure in another schema, see details below.  I don't know what are missing privileges (I already granted the EXECUTE privilege), suggestions?  -Thank you.

    Define a simple java class and deploy it as a Java stored procedure to test:


    Schema: User1

    test of the package;

    public class HelloWorld {}

    public HelloWorld() {

    Super();

    }

    public static String Hello () {}

    Return "HELLO";

    }

    }

    CREATE or REPLACE FUNCTION HELLO RETURN VARCHAR2 AUTHID CURRENT_USER AS LANGUAGE JAVA NAME ' test. HelloWorld.hello () return java.lang.String';

    Grant execute on USER2 HELLO

    Test the Java stored procedure through the PL/SQL function call (in the same schema):


    Schema: User1

    SET SERVEROUTPUT ON

    DECLARE

    v_Return VARCHAR2 (200);

    BEGIN

    v_Return: = User1. HELLO;

    DBMS_OUTPUT. Put_line ('v_Return =' | v_Return);

    END;

    anonymous block filled

    v_Return = HELLO

    Test the Java stored procedure through the PL/SQL function call in a different pattern:


    Schema: USER2

    SET SERVEROUTPUT ON

    DECLARE

    v_Return VARCHAR2 (200);

    BEGIN

    v_Return: = User1. HELLO;

    DBMS_OUTPUT. Put_line ('v_Return =' | v_Return);

    END;

    Error report-

    ORA-01031: insufficient privileges

    ORA-06512: at "User1." HELLO', line 1

    ORA-06512: at line 4 level

    01031 00000 - "insufficient privileges".

    * Cause: An attempt was made to change the user name or password

    without the privilege appropriate. This error also occurs if

    trying to install a database without the need for employment

    access privileges.

    When Trusted Oracle is configure in DBMS MAC, this error may occur

    If the user has been granted the privilege necessary for a higher label

    that the connection is active.

    * Action: Ask the database to perform the operation or grant administrator

    the required privileges.

    For users Trusted Oracle get this error, well that granted the

    the privilege that is suitable for the top label, ask the database

    administrator to grant the privilege to the appropriate label.

    You have created the function with AUTHID CURRENT_USER, which means that the function is executed with the rights of the applicant (but not with the rights of the author). This means that the applicant must have grants (directly or through roles) on all used/accessible objects in the service. In your case the user USER2 has not granted with EXECUTE on the class/source Java test. Class HelloWorld, causing the ORA-01031 exception. You create service without AUTHID CURRENT_USER (i.e. with AUTHID DEFINE, which is by default, if you do not have a specific reason to use AUTHID CURRENT_USER) or grant EXECUTE on JAVA test SOURCE. Class HelloWorld to User2.

    Dimitar

  • Launch of Lightroom 6 is not. error: "can't find the access point of the procedure _crtCreateSymbolicLinkW in the MSVCR110.dll dynamic link library.

    It says: "cannot find the access point of the procedure _crtCreateSymbolicLinkW in the MSVCR110.dll dynamic link library. What can I do? I have already uninstall and then reinstall the software...

    It is indeed a microsoft problem, check here:error "did not find the entry point _crtCreateSymbolicLinkW - Microsoft Community .

  • Error on the definition of the stored procedure in the simultaneous program

    Hello

    I created a stored procedure and wanted it attached to the concurrent program. The purpose of this stored procedure when you run it in simultaneous program, the system retrieves the data from the csv file downloaded from the server, then it will insert in the tables of SO / the Interface API. Below, the error occurred.


    * Starts * 18 April 2012 18:18:42
    Error ORACLE 6550 in FDPSTP

    Cause: FDPSTP failed due to the ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in the call to 'SPKO1 '.
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored

    Steps I did to set the stored proc
    < < simultaneous executable program > >

    Executable: RDRAGON_SO_IMPORT
    Short name: RDRAGON_SO_IMPORT
    Application: Order management
    Method of execution: PL/SQL, stored procedure
    Run file name: SPKO1

    < < concurrent program - set > >

    Program: RDRAGON SO IMPORT
    Short name: RDRAGON_SO_IMPORT
    Application: Order management
    Name of executable: RDRAGON_SO_IMPORT
    Method: PL/SQL, stored procedure

    Format: text
    No set

    -Here are my stored procedure-


    CREATE OR REPLACE PROCEDURE APPS. SPKO1 IS
    FH UTL_FILE. TYPE_DE_FICHIER;
    v_line VARCHAR2 (32767).
    v_source_id NUMBER (10);
    v_created_by NUMBER (10);
    v_creation_date DATE;

    v_org_id NUMBER (10);
    v_orig_sys_docref VARCHAR2 (50);
    V_Customer VARCHAR2 (360);
    v_customer_prev VARCHAR2 (360);
    v_sold_to_org NUMBER (10);

    v_orig_line_ref NUMBER (10);
    v_item_code VARCHAR2 (2000);
    v_ordered_qty NUMBER (10);
    v_selling_price NUMBER (10);
    v_count NUMBER (10);
    v_stat NUMBER;


    /******************************************************************************
    NAME: SPKO
    PURPOSE:

    REVISIONS:
    Worm Date Description of the author
    --------- ---------- --------------- ------------------------------------
    1.0 16/04/2012 administrator 1. Created this procedure.

    NOTES:

    Keywords to replace automatically available Auto:
    Object name: SPKO
    SYSDATE: 16/04/2012
    Date and time: 16/04/2012, 17:55:42 and 16/04/2012 17:55:42
    Username: admin (set in Options of TOAD, editor of the procedure)
    Name of the table: (defined in the dialog box "New PL/SQL object")

    ******************************************************************************/
    BEGIN
    v_source_id: = 6;
    v_created_by: = - 1;
    v_org_id: = 204;
    v_customer_prev: = null;
    v_orig_line_ref: = 0;
    v_stat: = 0;

    SELECT header_id in (DE) v_orig_sys_docref
    Select header_id
    of OE_ORDER_HEADERS_ALL
    creation_date desc order
    ) WHERE ROWNUM = 1;


    FH: = UTL_FILE. FOPEN ('XXANDDIR2', 'myfile1.csv', 'R', 32767);
    < < file_read_lines > >
    LOOP
    BEGIN
    UTL_FILE. GET_LINE (fh, v_line);

    V_Customer: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 1") ',' "') ','" ');
    v_creation_date: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 2") ',' "') ','" ');
    v_item_code: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 3") ',' "') ','" ');
    v_ordered_qty: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 4") ',' "') ','" ');
    v_selling_price: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 5") ',' "') ','" ');
    v_orig_line_ref: = (v_orig_line_ref + 1);

    If v_stat = 0 then
    v_orig_sys_docref: = (v_orig_sys_docref + 1);
    end if;

    SELECT hca.cust_account_id from v_sold_to_org
    OF hz_cust_accounts AOB.
    HP hz_parties
    WHERE hca.party_id = hp.party_id
    AND hca.request_id is null
    AND hp.party_name = v_customer;

    If v_stat = 0 then
    INSERT INTO OE_HEADERS_IFACE_ALL)
    order_source_id,
    orig_sys_document_ref,
    org_id,
    CREATION_DATE,
    created_by,
    last_update_date,
    last_updated_by,
    operation_code,
    sold_to_org_id,
    booked_flag)
    VALUES)
    v_source_id,
    ('TEST' | v_orig_sys_docref).
    v_org_id,
    v_creation_date,
    v_created_by,
    v_creation_date,
    v_created_by,
    "INSERT."
    v_sold_to_org,
    'Y') ;
    commit;
    end if;

    INSERT INTO OE_LINES_IFACE_ALL)
    order_source_id,
    orig_sys_document_ref,
    orig_sys_line_ref,
    inventory_item,
    org_id,
    ordered_quantity,
    unit_selling_price,
    unit_list_price,
    CREATION_DATE,
    created_by,
    last_update_date,
    last_updated_by,
    operation_code)
    VALUES)
    v_source_id,
    ('TEST' | v_orig_sys_docref).
    v_orig_line_ref,
    v_item_code,
    v_org_id,
    v_ordered_qty,
    v_selling_price,
    v_selling_price,
    v_creation_date,
    v_created_by,
    v_creation_date,
    v_created_by,
    "INSERT");
    commit;

    v_customer_prev: = v_customer;
    If v_customer_prev = v_customer then
    v_stat: = 1;
    on the other
    v_stat: = 0;
    end if;
    -DBMS_OUTPUT. Put_line ('Col1: ' | v_source_id |', Col2: ' | v_creation_date |', Col3: ' | v_created_by |', Col4: ' | v_updated_date |', Col5: ' | v_updated_by);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    OUTPUT file_read_lines;
    END;
    END LOOP;
    SELECT count (*) in the OE_HEADERS_IFACE_ALL v_count;
    DBMS_OUTPUT. Put_line (' record Total inserted successfully: ' | v_count);
    UTL_FILE. FCLOSE (FH);

    END SPKO1;
    /


    But when I run the stored procedure using TOAD his work.

    Help, please. This is my first time to attach the stored procedure in the concurrent program.

    Thank you very much.

    Kind regards
    Diane

    Published by: peopsquik08 on April 18, 2012 03:58

    as clive_t solier
    >
    You must explicitly reference the settings out
    >

    Try

    DECLARE
    VFILE VARCHAR2(32767);
    V_SOURCE_ID NUMBER;
    --
    ERRBUF VARCHAR2(200);
    RETCODE NUMBER;
    
    BEGIN
    VFILE := 'myfile1.csv';
    V_SOURCE_ID := 6;
    
    --APPS.OMORDERLOADER.SPKO1 ( VFILE, V_SOURCE_ID );
    --COMMIT;
    
    APPS.OMORDERLOADER.SPKO1(
        ERRBUF => ERRBUF,
        RETCODE => RETCODE,
        VFILE => VFILE,
        V_SOURCE_ID => V_SOURCE_ID
      );
    END;
    

    but the code above to test your proc

    to run concurrent SQL, you can use fnd_submit.submit_program

  • 403 Forbidden error of execution of the procedures of the URL of the browser stored

    I am currently trying to run a simple stored procedure (ea.hello_world, where "ea" is the pattern and "hello_world" is the name of the procedure) a URL from the browser, but am getting a 403 Forbidden - error message "you don't have permission to access /pls/apex/ea.hello_world on this server. I use APEX 3.2 with Oracle 11 g and mod_plsql and gave the steps of apex_public_user. Any thoughts on what I am doing wrong?

    Here is the process I have used so far:

    Create the "Hello_World" procedure in the "EA: schema

    create or replace
    procedure hello_world
    is
    Start
    HTP. Print ("'Hello World!");
    end;

    I then successfully granted to run the apex_public_user procedure:

    Grant execute on ea.hello_world to apex_public_user;

    Then, I tried to call the stored procedure from the browser using the following syntax:

    http:// < Server >: < port > / pls/apex/< schema >. < Procedure & gt;

    I also experimented with the use of a public synonym and the configuration of the wwv_flow_epg_include_mod_local, but I do not think that the function s relevant since I'm using mod_plsql and not the embedded pl/sql gateway.

    Hello

    If you have below the line in dads.conf, then wwv_flow_epg_include_mod_local sets

    PlsqlRequestValidationFunction wwv_flow_epg_include_modules.authorize
    

    Try:
    Create public synonym

    CREATE PUBLIC SYNONYM hello_world FOR ea.hello_world;
    

    Grant privilege to execute procedure to the public

    GRANT execute on hello_world to public;
    

    Then change the APEX_030200.wwv_flow_epg_include_mod_local function

    CREATE OR REPLACE FUNCTION
    APEX_030200.wwv_flow_epg_include_mod_local(
        PROCEDURE_NAME IN VARCHAR2)
    RETURN BOOLEAN
    IS
    BEGIN  
    
        IF UPPER(procedure_name) IN (
              UPPER('hello_world'))
       THEN
            RETURN TRUE;
        ELSE
            RETURN FALSE;
        END IF;
    END;
    /
    

    Then try
    http://:/pls/apex/hello_world

    If you can now run your procedure in URL, you can then low and e.g. grant execute procedure to the user of DAD.

    Kind regards
    Jari

    http://dbswh.webhop.NET/dbswh/f?p=blog:Home:0

    Published by: jarola on December 6, 2011 16:20

    Published by: jarola on December 6, 2011 16:24

    typo in the name of the function

  • Error in retrieving the stored procedure of the DB JDev adapter

    Hello
    I am facing a problem when configuring Jdeveloper stored procedures using the DB adapter. I use in my Sql Server 2005 database, version Jdeveloper 10.1.3.3 Version 10.1.3.1.Bpel. Connection to the database SQL Server 2005 is good, but it only displays the views and tables. I get the following error message when I try to add the sql stored procedure call
    "An error occurred while getting the database schemas. Make sure the database connection is valid and is supported"

    Can someone help me please.

    Thank you
    Phani

    Published by: Brad on October 28, 2008 11:30

    Post your email and I'll send you a complete tutorial of SQL Server.

  • Error number statup topic = the procedure entry point xml name AppleSyncNotifier.exe text reader const could not be located in the dynamic link libxl2.dll

    Original title: sign of problems

    at the start of my system, I get the following, called = AppleSyncNotifier.exe he then continued to say in the dialog = the procedure entry point xml text reader const name could not be located in the dynamic link libxl2.dll, it prevents me from doing whatever it is on the opening page, anyone help? John

    Hello

    AppleSyncNotifier.exe is part of ITunes. To resolve the issue, try the following methods.

    Method 1:

    I suggest that you download and reinstall ITunes since this link provided below to fix the problem.

    http://www.Apple.com/downloads/

    Method 2:

    You can perform the clean boot in order to eliminate the problem.

    Put your boot system helps determine if third-party applications or startup items are causing the problem. If so, you need to maybe contact the manufacturer of the program for updates or uninstall and reinstall the program.

    See the following article in the Microsoft KB for more information on how to solve a problem by performing a clean boot in Windows Vista or Windows 7:

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    http://support.Microsoft.com/kb/929135

    Note:

    After troubleshooting, be sure to set the computer to start as usual as mentioned in step 7 in the above article.

    For further assistance, you can get in touch with support for ITunes.

    https://discussions.Apple.com/community/iTunes?CategoryID=149

  • EXC in ev handl: error: Bad NPObject as private data!

    Just updated to FF 3.6.23. Running on Vista Business Premium. Now, whenever FF navigates to a new page, it displays this error message: "Exc in ev handl: error: Bad NPObject as private data!" with a button to be clicked before the page OK takes over. ALL PAGES.

    See http://kb.mozillazine.org/Problematic_extensions
    and then the statement of the problem and the solution for Site Advisor.

  • I get this error message and Firefox does not start... EXC in ev handl: error: error definition property on NPObject!

    Firefox does not start and this message keeps coming back... I uninstalled and reinstalled... but nothing helped...

    EXC in ev handl: error: error definition property on NPObject!

    Disable the extension "McAfee Site Advisor" who has just updated 3.4.0 that probably out of block of addons list.

    • 'Ctrl + Shift + A' > find McAfee Site Advisor and use 'Disable', and then restart Firefox.
    • Do a Google search without problem
    • It seems that if you re - enable new Site Advisor and restart Firefox you agree. At least you know where to look if you get the error again, or research on Google to slow down.

Maybe you are looking for