Raise_application_error displaying error message not personalized

I'm quite new to PL/SQL, and I have a problem with the display of my exceptions that I can't understand.

I use two stored procedures and anonymous block to call them. I did some other procedures in this way and they all work very well.

It is the first procedure that updates my table.

create or replace procedure UPD_CUST_SALESYTD_IN_DB (pcustid number, pamt number) AS 
err_pamt exception
;
err_pcustid exception
;
vcount number
;
begin
select count(*) into vcount from customer where custid = pcustid; 

if vcount = 0 then raise err_pcustid;
end if; 

if pamt <-999.99 or pamt >999.99 then raise err_pamt;
end if; 

update customer set sales_ytd = sales_ytd + pamt
where custid = pcustid; 

exception
when err_pcustid then
RAISE_APPLICATION_ERROR
(-20031, 'Customer ID not found');
when err_pamt then
RAISE_APPLICATION_ERROR
(-20032, 'Amount out of range');
when others then
RAISE_APPLICATION_ERROR
(-20000, SQLERRM);
end; 

It is the procedure that calls the procedure above. It shows just what I'll do and confirms that it worked.

create or replace procedure UPD_CUST_SALESYTD_VIASQLDEV (pcustid number, pamt number) AS 
begin
dbms_output
.put_line('--------------------------------------------');
dbms_output
.put_line('Updating SalesYTD. Customer Id: ' || pcustid || ' Amount: ' || pamt);
UPD_CUST_SALESYTD_IN_DB
(pcustid, pamt);
commit;
dbms_output
.put_line('Udpate OK');

exception
when others then
RAISE_APPLICATION_ERROR
(-20000, SQLERRM);
end;

It is the anonymous block to call the procedure above, which then calls one I use.

set serveroutput on; 
begin
UPD_CUST_SALESYTD_VIASQLDEV
(3,999.9);
end;

If I pass parameters which would not give me an error, the code works fine.

For example, if I input;

set serveroutput on; 
begin
upd_cust_salesytd_viasqldev
(3,400);
end;

I get the correct result and made the changes in the table.

-------------------------------------------- 
Updating SalesYTD
. Customer Id: 3 Amount: 400
Udpate OK

However, if I pass parameters that would result in an error, or a customer id doesn't exist does not, either the amount being out of reach, nothing happens. I get this:

-------------------------------------------- 
Updating SalesYTD
. Customer Id: 3 Amount: 1000

Nothing else.

In similar procedures my exceptions work very well. This example uses a procedure that inserts into a table.

-------------------------------------------- 
Adding Customer
. ID: 500  Name: Helen Nolan
ORA-20002
: Customer ID out of range

I don't know why this procedure is not at all my exceptions. In my other procedures that work, if an exception is thrown, the right output script in Oracle SQL Developer displays my exception.

However, in my update procedure, if something should trigger an exception, over the lines of DBMS output, the output of the script prints this error report

Error report - 
ORA-20000
: ORA-20032: Amount out of range ORA-06512:
at
"S4931645.UPD_CUST_SALESYTD_VIASQLDEV", line 10 ORA-06512:
at line
2 20000. 00000 -  "%s"
*Cause:  The stored procedure 'raise_application_error' was called which causes this error to be generated.
*Action:  Correct the problem as described in the error message or contact the application administrator or DBA for more information.

So he is grateful he my exception was raised, but it has not been demonstrated.

Any help is greatly appreciated, I am completely confused by this. I have a really obvious mistake?

Your logic and exception management is wrong.

(a) make a count to determine the existence of a record prior to an update on this subject is wrong.  If the record is deleted by another user inbetween you your county and the update, then you can try and update a record that no longer exists.

(b) while other exceptions are to be avoided - only handle exceptions, you expect to be raised.

(c) update a record will set the SQL % ROWCOUNT pseudo variable, which should be checked immediately after the statement and used to determine if the record exists or not...

create or replace procedure UPD_CUST_SALESYTD_IN_DB (number pcustid, number of ALMPs) AS
err_pamt exception;
err_pcustid exception;
Start
If abs (ALMPs) > 999.99 then
raise err_pamt;
end if;

customer update
Set sales_ytd = sales_ytd + ALMPs
where custid = pcustid;

If rowcount % sql = 0 then
raise err_pcustid;
exception
/ * Business Logic Exceptions * /.
When err_pcustid then
RAISE_APPLICATION_ERROR (-20031, "Customer ID not found");
When err_pamt then
RAISE_APPLICATION_ERROR (-20032, 'Amount out of reach');
-Deletion of STUPID WHEN OTHERS Manager of exceptions that masks the true exceptions
-while others then
-RAISE_APPLICATION_ERROR(-20000, SQLERRM);
end;

Tags: Database

Similar Questions

  • HP Laserjet 1010: Unable to print. error message "unsupported personality: PCL.

    Hello!

    I had my old HP Laserjet 1010 installed on my HP ProBook 650 G1 sucessfully. Yesterday interrupted with an error message like "personality unsupported PCL"

    Can help you...

    Concerning

    Raimo

    Raimo1 wrote:

    Hello!

    I had my old HP Laserjet 1010 installed on my HP ProBook 650 G1 sucessfully. Yesterday interrupted with an error message like "personality unsupported PCL"

    Can help you...

    Concerning

    Raimo

    Hello

    http://h30434.www3.HP.com/T5/LaserJet-printing/unsupported-personality-PCL-on-LaserJet-1012-printing-from/TD-p/470237

    HP will not develop a Windows 10 driver for this printer. The best option is to buy a new printer or get a laptop computer with the operating system prior to Windows 7 because this error occurred on Windows 7 computers due to inadequate software support driver for the printer. Perhaps a simple shooting turn also works as described in the link.

  • A single application preventing the closure of the displayed error message...

    Hello

    When I closed my laptop, the displayed error message one application preventing closing down.

    as directed by your previous post, I have set up my laptop with it, but this problem yet and still occur.

    now the error message saying Windows host prevents your stop down.

    Please, help me to overcome this problem.

    Hi Regis,

    Thanks for posting your question on the Microsoft Community forums.

    I understand that you get the error message so that the closure of the system. However, I would like to know some more information on the issue to provide you with better assistance.

    1. Who is "previous post" you are talking about?
    2. What is the exact error message you get now on "Windows"host?
    3. You did it any significant hardware or change software on the computer before this problem?

    The question may arise if certain services (including background Windows services and other third-party application services) are still in operation when you try to shut down the computer.

    The applications or programs sometimes have ongoing services which are still ongoing even if you close your programs. Properties of an instance, there are many third party messengers that require you to sign in to use the application. Thus, when you close the application, the corresponding services are sometimes even functional whereby the program restarted in less time and log into the self-signed.

    Therefore, usually do not completely quit us some programs when we literally close them and so we get these guests. To diagnose the problem, you can restart the computer in safe mode when only minimal services are in use, you should not get these guests so that closing.

    If you do not get these guests in safe mode, you can also try to boot your system in a clean boot, a selective startup in the third that most of the services are disabled. To do this, you can consult the following link:

    How to perform a clean boot in Windows

    Note: See "how to reset the computer to start normally after a boot minimum troubleshooting" to prepare the computer to start as usual after a repair.

    Hope this information is useful. Let us know if you need additional help on the issue, we will be happy to help you.

  • RH10: Test connection displays error: could not contact the site at the specified url.

    Hello

    I am using sharepoint as a control source code for my project. Here are the steps mentioned in the link of reference robohelp 10.

    Step 1 & 2 are completed successfully. But in step 3, when I add version control, an error message appears.

    File-> Version Control-> add to version control-> connector Sharepoint RoboHelp-> Ok-> enter Sharepoint site-> test the connection

    Error message: "test connection displays error: could not contact the site at the specified url.» There is no web named *. "/ _vti_bin/sites.asmx.

    Help, please.

    Hello

    Using SharePoint 2010? Earlier versions are not supported for version control.

    What is the URL that you use? You must point RH on the site or subsite holding library. Not the library itself.

    Take a bow

    Willam

  • I use Firefox version 3.0.19 and I have Windows 7. When I use Firefox as a browser, I can't print my emails. I get an error message: «not available pcfax» If I use IE I don't have no problems printing emails.

    I use Firefox version 3.0.19 and I have Windows 7, which came with a new computer. When I use Firefox as a browser, I can't print my emails. I get an error message: «not available pcfax» If I use IE I don't have no problems printing emails.

    This has happened

    Each time Firefox opened

    == 1 day with the new computer about two weeks ago.

    Looks like you got the wrong printer selected.

    When you get the print window, choose another printer in your printer dropdown. You seem to have a fax printer selected instead of a physical printer.

  • Windows photo printing Wizard error message "not enough memory available"?

    Windows photo printing wizard when trying to print a jpeg photo get error message "not enough memory is available for rocess this command" I talked to my tech guy and he said another customer is having the same problem.  Is this a problem with a recent update?  How to fix?  This worked well before

    You can try try by forming http://support.microsoft.com/kb/315265 of disk error checking
    You can also try the steps in this link http://support.microsoft.com/default.aspx?scid=kb;en-us;241258

  • I use Windows Live Mail and when I access the contacts screen I get an error message "Not responding" when I try to access anything whatsoever.

    I use Windows Live Mail and when I access the contacts screen I get an error message "Not responding" when I try to access anything whatsoever.

    Hello Brenda,.

    The best place to ask your question of Windows Live is inside Windows Live help forums. Experts specialize in all things, Windows Live, and would be delighted to help you with your questions. Please choose a product below to be redirected to the appropriate community:

     

    Windows Live Mail

    Windows Live Hotmail

    Windows Live Messenger

    Looking for a different product to Windows Live? Visit the home page Windows Live Help for the complete list of Windows Live forums to www.windowslivehelp.com.

  • error message-"not enough memory to process this command" when I try to install dragon naturally speaking v 11

    When you try to install dragon naturally speaking 11 I get the error message "not enough avaibale from storage to process this command." What gives? Dragon says it is compatible with my windows vista Home premium 64-bit. I downloaded on the internet and therefore have no set upwards or the installation disc.

    Hi MMBleakley,

    1 do you receive the error message only when you try to install this program?

    Method 1:

    Right-click on the installation files and select run as administrator to install the program.

    Method 2:

    Alternatively, you can try to run a disk cleanup to remove unwanted files and check if the problem persists.

    Delete files using disk cleanup

    For more information, please see the following link:

    http://TechNet.Microsoft.com/en-us/library/cc978735.aspx

    Method 3:

    If you're still having problems, try to perform a clean boot, and then install the program.

    A clean boot helps eliminate software conflicts. You can check the link below for how to put the computer in a clean boot.

    http://support.Microsoft.com/kb/929135
    Note: After installing the program, see the section on boot link to how to restore your computer to a Normal startup mode.

    Hope this information is useful.

  • Error message: "not enough server memory is available to process this command" tries to open the network when the folder shared

    When an XP machine is peer-to-peer by ethernet to a 7 W machine, sometimes the XP machine cannot access the files W 7 and the Xp machine displays the message "not enough memory server is available... "the W7 machine retart solves the problem, but the problem recurrs each week.

    Hi Richard hartwell,.

    Could you tell what antivirus software you have installed on your Windows XP machine?

    The problem occurs because of a software antivirus installed on your Windows XP computer.

    See article Knowledge Base MicrosoftAntivirus software may Cause Event ID 2011 for a likely solution, specifying a value of IRPStackSize 15 on the Windows XP computer.

    As a test, you can consider disabling the security software on your Windows 7 machine as well.

    http://Windows.Microsoft.com/en-us/Windows7/turn-Windows-Firewall-on-or-off

    http://Windows.Microsoft.com/en-us/Windows7/disable-antivirus-software

    Note: Allow all security software after the trial.

    Aziz Nadeem - Microsoft Support

    [If this post was helpful, please click the button "Vote as helpful" (green triangle). If it can help solve your problem, click on the button 'Propose as answer' or 'mark as answer '. [By proposing / marking a post as answer or useful you help others find the answer more quickly.]

  • I downloaded my CSDesignWebPremium and when I tried to mount the drive - a 'DesignWebPremium, _CS6_LS16.dmg' says error message not recognized

    I downloaded my CSDesignWebPremium and when I tried to mount the drive - a 'DesignWebPremium, _CS6_LS16.dmg' says error message not recognized

    (I use a MAC 2.6 GHz Intel Core i7 (16 GB 1600 MHz DDR3) OSX 10.7.5)

    Squasha9, it seems that the downloaded DMG is corrupt.  Where you downloaded the installation files from?  You can download a copy of produced CS6 downloadinstallation files.

  • When you install Adobe Presenter, get error message not compatible platform.

    When you install Adobe Presenter, get error message not compatible platform.

    Check the tech specifications to see if your system meets the minimum requirements for the software.

  • ORA-273xx OS OS system error message: not enough space in CAR 11.0.1.7

    Hello world

    We have Oracle RAC on HP - UX 11.32 with two knots after a while that one of the nodes had shot and you cannot issue an order until the server is restarted.


    Here is a log of messages in the queue alerts.

    ERRORS
    =======
    Process m00D died, see the trace file
    Boot process failed, error of the battery:
    Errors in the /u01/app/oracle/diag/rdbms/ecmprd/ECMPRD2/trace/ECMPRD2_psp0_9389.trc file:
    ORA-27300: OS dependent operating system: fork failed with status: 12
    ORA-27301: OS Error Message: not enough space
    ORA-27302: an error occurred at: skgpspawn3
    M007 died the process, see the trace file



    Trace file
    ============
    2011-01-18 15:03:19.980
    Boot process failed, error of the battery:
    ORA-27300: OS dependent operating system: fork failed with status: 12
    ORA-27301: OS Error Message: not enough space
    ORA-27302: an error occurred at: skgpspawn3

    2011-01-18 15:13:20.135
    Boot process failed, error of the battery:
    ORA-27300: OS dependent operating system: fork failed with status: 11
    ORA-27301: OS Error Message: Resource temporarily unavailable
    ORA-27302: an error occurred at: skgpspawn5



    I think it's the limitation or problem of operating system kernel. no luck that we stuck with bad engineer as we took a week, but no action until now I try now he climbs, we open bu SR.

    Anyway any idea that will really help

    DB v 11.1.0.7


    Thank you

    Hello

    See the TechNote MOS:

    * Troubleshooting error ORA-27300 ORA-27301 ORA-27302 [579365.1 ID] *.

    Thank you
    A H E E R X

  • cftry / cfcatch do not display error message

    I'm trying to display an error message when a user selects incorrectly two elements. But the message does not appear. Please let me know what I am doing wrong. On the page of the form, the user selects couse them and types in their identification. If the ID and classes are not already in the same table in the database, they should then be invited to try again. Here is my code

    < cftry >
    < cfquery name = "all" datasource = "hr1" >
    Select EMPLID, COURSE_TITLE
    Training
    WHERE EMPLID ='#FORM. EMPLOYID #'
    And as COURSE_TITLE ' #FORM. CLASS #% '
    < / cfquery >

    < cfcatch type = "any" >
    <!--> the message to display
    < cfoutput > we do not show you enrolled in this course, please select another < / cfoutput >

    < / cfcatch >
    < / cftry >

    Thanks for all the help. I found another solution in another forum. Since fails it to query is not complete a registration account. I had to go back to the CFTry and return the query. This code works-



    Select EMPLID, COURSE_TITLE
    Training
    WHERE EMPLID ='#FORM. EMPLOYID #'
    And as COURSE_TITLE ' #FORM. CLASS #% '




    Then using the recordcount function it generates the correct answer



    #form.employID # wishes to withdraw the course #COURSE_TITLE #.
    You have chosen to cancel the registration of #COURSE_TITLE #. An email was sent to your supervisor.

    Our records do not show whether you are enrolled in this course. Please select another.

  • raiseBundledOAException does not display error messages

    Hello!

    I have a problem with throwing Exception delivered:

    I am adding OAExceptions to my ExceptionList and then calling OAException.raiseBundledOAException (ExceptionList);

    But on the page only dialogue error message shows with 'Error' header and any error messages that have been provided with ExceptionList:

    error.jpg

    My code:

    Co of the PFR:

    If ("UploadFile".equals (pageContext.getParameter (EVENT_PARAM)))

    {

    xxUtils.UploadFile (pageContext, webBean);

    }

    In xxUtils.UploadFile ():

    import com.sun.java.util.collections.ArrayList;

    import com.sun.java.util.collections.List;

    ...

    Lists errors = new ArrayList();

    ...

    If (Condition1)

    {

    OAException Error1 = new OAException ("error 1", OAException.ERROR);

    Errors.Add (mistake1);

    }

    If (Condition2)

    {

    OAException Error2 = new OAException ("error 2", OAException.ERROR);

    Errors.Add (Error2);

    }

    If (Condition3)

    {

    OAException Error3 = new OAException ("error 3", OAException.ERROR);

    Errors.Add (Error3);

    }


    If (Errors.size () > 0)

    {

    System.out.println ("errors. Size() = "+ Errors.size ());

    System.out.println (Errors);

    OAException.raiseBundledOAException ((List) Errors);

    }

    Output, I see the right size of list of errors and the appropriate error message:

    15/03/30 10:47:47 Errors.size () = 1

    15/03/30 10:47:47 [oracle.apps.fnd.framework.OAException: 3 error message]

    What I am doing wrong?

    Kind regards

    Alex

    Alex,

    Will you be able to paste the complete code of your CO and the class xxUtils?

    Copy the following code is written in a try/catch block?

    The code below is good enough to throw the error as long as the size is greater than 0.

    Errors of the ArrayList = new ArrayList();

    OAException.raiseBundledOAException (Errors);

    See you soon

    AJ

  • Error message: not available with this Apple ID update

    App Store displays the available updates, but after choosing "Update", the error message starts "Update not available with this Apple ID" appears. All of the applications in question were purchased with the current Apple ID.

    Mac Pro (2008), 10.11.4

    Please test after each of the steps that you have not already tried it. Stop when the problem is resolved. Back up all data before making any changes. Remember, no one here is Apple or can help in problems of service the customer.

    Step 1

    If you have recently changed something in your Apple ID account (for example, the password), log out of the App Store and reconnect.

    Step 2

    A purchased app can only be updated by logging into the App Store with the same identifier Apple which was originally used to buy it. There is no way around this restriction, which applies also to the free applications. If you can not connect to help ID the buyer, remove the app and reinstall it. You will have to pay for it, once again, as appropriate.

    Step 3

    If you receive the alert when you try to update a grouped iLife application, select the shopping page in the App Store and find the application in your purchase history. If there is a button marked ACCEPT on the right, click on it.

    If you have a used Mac, bundled apps related to Apple ID of the original owner and may apply to you. Reportedly, customer service has published codes redemption to some owners of second who asked, but it is not guaranteed.

    Step 4

    If you try to update the iLife or iWork applications that were installed from a purchased DVD, or if you have a refurbished Mac purchased directly from Apple, contact App Store customer service for a redemption code. If necessary, you will be asked for the part number of the DVD.

    Step 5

    In the App Store menu bar, select

    Store ▹ view my account

    Enter your Apple ID to the command prompt. In the lower right corner of the window that opens, click the reset button. Close the window.

Maybe you are looking for

  • Equium P200 - using Synaptics Pointing Device - keeps minimizing my screen

    Just bought the laptop for all devices must be updated. The touchpad uses the Synaptics pointing device and often closes my screen or it minimises when I'm with her, be it in my email account or online. You know not so relevant but have installed Vis

  • Is there that something called "permission to start?

    It is supposed to allow to choose what applications start automatically after turning on the phone. Is this what? If so where is it?

  • My laptop does not recognize the disc that I put in the cd/dvd rom

    My laptop does not recognize the disks I put in the disc/dvd rom disc... What wrong with it? How to operate? I'm running on windows xp. My laptop is a Dell Inspiron 6000 Original title: my laptop does not recognize the disks I put in the disc/dvd rom

  • Protective coating of graphics card?

    Hi I just got my GTX 970 and I installed it fine and everything, but I think I left a little bit of plastic on the map. Will be the melting plastic or he'll be fine? Thanks :)

  • HP pavilion d7 cutting guard screen

    Hi I have the portable entertainment d7 and the screen begins to turn in a random way and have difficulty making him Turn on. I have to close and open a bunch of times. It lights up at startup and then stops, I'll close it then open it and it turns o