How can I obtain an specific message raised by a database trigger

Dear friends,
if I have a database trigger and I want to show an error message which was raised from a database trigger to a form, I can do it by raising an application error inside database trigger, and by showing DBMS_ERROR_TEXT inside ON-ERROR trigger. This is ok for me.
But how can I do if I want to show a specific message? Let's say I have a BEFORE INSERT table trigger, and I want to verify whether data was correctly informed (for example, "user name must be entered"). If I raise an application error, I see a very big error message which includes both my personal error message and database message.
Surely I can do a SUBSTR in this message, but can't I do something easier? Let's say I put all error messages in a variable:
(Let's suppose it's a BEFORE INSERT trigger code, which is related to my table)
if :NEW.user_name is null then
p_error_message := 'User name must be entered.';
end if;
if p_error_message is not null then
raise_application_error (-20000, p_error_message);
end if;
... with this p_error_message being shown to final user, with no need to edit it via PL/SQL instructions like SUBSTR. Is this possible? If not, I'll be quite satisfied with SUBSTR because it fits my needs somehow.
Best regards,

raise_application_error will be used for raise errors on form.here i'm providing u the example
CREATE TRIGGER at AFTER UPDATE OR DELETE OR INSERT ON emp
for each row
declare
v_1 number
begin
select empno into v_1 from emp where empno=7369 ;
exception when no_data_found then
RAISE_APPLICATION_ERROR(-20001,'No data found'||sqlerrm);
END;
now when you insert data on emp table through form. if value does not found of selected empno then No data found will be shown on form
Edited by: SKYNIAZI on Mar 20, 2009 12:19 PM
Edited by: SKYNIAZI on Mar 20, 2009 12:56 PM

Similar Messages

  • How can I obtain a version of Print Studio Pro that works with Photoshop Elements 13 (64 bit)?

    How can I obtain a version of Print Studio Pro that works with Photoshop Elements 13 (64 bit)?  The advertising refers to Print Studio Pro 2 but all I find available to download is version 1.35.

    Thanks - I did notice that the 2 was a superscript on one site but on another (I think the one for the Pro-10 printer) it was definitely a 2 in line with the rest of the text and separated by a space (at least on my browser).  At any rate, I suspected something of the kind and will simply use Photoshop Elements 11 when I want a pattern print until the change is made.
    If you have an inside line to Canon you might also suggest some changes to their Image Garden program, specifically its handling of DVD label projects.  It has several themes and within each theme several layouts.  As far as they go these are fine but they do not give nearly enough flexibility.   The boxes for insertion of images are useful as is the simple procedure for rescaling the image so it is cropped in varying ways while staying within the fixed box.  However, it should be possible (a) to relocate the boxes on the page and (b) to resize and reshape the boxes - probably by a control which would become available by right-clicking on the box.  For example, there are times when the user might want to include a full 16 x 9 frame shot as one of the images, and in general the aspect ratios of the provided boxes do not permit this.
    I have over the years preferred to use Word for this purpose after setting up masks to expose just the printable area of the DVD or Blu-ray disc, setting up the margins so that the center of the disc is in the horizontal center of the page, and finally introducing text and pictures and adjusting the font size of blank lines above the disc to line everything up properly in the vertical direction.  A typical layout might involve one large picture, located so the center hole and the curved outer edge do not block anything important, or two pictures side by side, or four pictures centered vertically (to minimize the effect of the outer edge of the disc) but possibly of different widths (so as to make both close-ups and wide scenes optimal on the same disc label).  The text then goes above and below the pictures.  All of this works perfectly so I probably wouldn't use Image Garden very often for this purpose, but the inability to resize and relocate the boxes must be very limiting for others as well. 
    Some of the layouts have image locations severely reduced by the edge of the disc.
    As I said ... if you have an inside line to Canon .. but if not, please excuse the length of this post!

  • How can I obtain the coefficients m, b from MAX scale?

    I use CWAI ActiveX for acquire data. Also, I use MAX to set the virtual channels for CWAI. When I try to use scale option of MAX (for exemple y = 0.5x + 3 to transforn volts in my phisics values) I obtain true data from ScaledData (phisics values), but I can't obtain true data from (BinaryCodes x GetScaleMultiplyer) + GetScaleOffset. How can I obtain true value from binarycodes?
    How can I obtain m and b from ActiveX?

    drg,
    The GetScaleOffset & GetScaleMultiplier refer to the hardware factors used by the driver to transform the binary values produced by the ADC converter to actual Voltage values (not physical units of the Virtual Channel).
    The documentation (NI-DAQ 6.9.3) for the ScaleMultiplier property mentions this:
    "Returns the slope in the linear scaling formula for converting the binary codes of the analog-digital converter to voltages. The CWAI control multiplies the binary code by the ScaleMultiplier and adds the ScaleOffset to convert a binary code to a voltage.
    (BinaryCode * ScaleMultiplier) + ScaleOffset = Voltage"
    If the signal range was, for example +/- 5 V, the multiplier for a 12 bit board would be approximately 0.00244141 so that:
    2047 * 0.002441
    41 = 5V
    NOTE: The 12 bit range (4096 words) is divided into +2047 / -2048
    Unfortuantely there is not a function or method in the CWDAQ API to obtain or set parameters from the Custom Scales used by the Virtual Channels.
    The reason for this is probably due to the fact that once Virtual Channels are created, most users would read in scaled values directly rather than reading binary values, getting the scale constants and applying the custom scale themselves. Since the user specifies the values for the custom scales anyway, the application could as well store the scaling constants as part of its configuration.
    Still, it would be nice to have this functionality so I thank you for pointing this out. I will create a suggestion indicating the need for such functions.
    The ways to achieve the results you desire are:
    1) Use Virtual Channels and read scaled data
    or
    2) Use the ScaleMultiplier and ScaleConstants to transform binary values into actual voltage values. Once
    you obtain the voltage values you can manually apply the same custom linear scale you had created through MAX.
    Regards,
    Alejandro Asenjo
    Applications Engineer
    National Instruments

  • How can I obtain Adobe Inspirational Browser?

    I have tried to download Inspiration Browser from the Welcome screen and in help from Photoshop Elements 10 but I get an error everytime? I've been frustrated two days now!

    2012/8/11 Dan E Jacobsen <[email protected]>
       How can I obtain Adobe Inspirational Browser?  created by Dan E
    Jacobsen <http://forums.adobe.com/people/DanEJacobsen> in *Downloading,
    Installing, Setting Up* - View the full discussion<http://forums.adobe.com/message/4613333#4613333

  • How can you disable receiving Broadcast Messages?

    How can you disable receiving Broadcast Messages 
    Without deleting your Contacts ?

    I don't have access to my phone at the moment so I'm going on memory alone.  On your homescreen follow Options>Advanced System Settings>Cell Broadcasting, or maybe you'll see Options>Device>Advanced System Settings>Cell Broadcasting.  I'm sorry I can't be more specific without a phone in front of me.
    Let us know if that helps you. 
    - If my response has helped you, please click "Options" beside my post and mark it as solved. Clicking the "thumbs up" icon near the bottom of my response would also be appreciated.

  • When I update my nano ipod I get an error message "User ipod cannot be updated.  The disk couldnot be read from or written to."   How can I overcome this error message.

    In the iTunes window, when I update my nano ipod, I get an error message "User ipod cannot be updated.  The disk could not be read from or written to."   How can I overcome this error message.

    Hello there dilip77707,
    It sounds like you are getting this error message that your iPod cannot be read from or written to when you are trying to update your iPod Nano. I recommend the troubleshooting from the following article to help you get that resolved. Its pretty straight forward, just start at the top and work your way down as needed:
     'Disk cannot be read from or written to' when syncing iPod or 'Firmware update failure' error when updating or restoring iPod
    Thank you for using Apple Support Communities.
    All the very best,
    Sterling

  • I need to install photoshop cs4 extended from a disk to a new computer because my old computer had a hard drive crash. There is no serial number on the back of the case.  How can I obtain a usable serial number?

    I have to install Photoshop CS4 extended on a new computer from a disk because my old computer had a hard drive crash.  There is no serial number on the back of the case.  How can I obtain a usable serial number?

    Find your serial number quickly
    You can activate software without following up and registering it... at least that was the case in the past.  The serial number is normally located on the disc case or a box inside the main box.  If you did not purchase the disc from Adobe then it is possible you would have dealt with a redemption code, in which case it would have been up to you to keep a record of the serial number, especially if you did not follow up and register the software.

  • How can i stop an error message that comes up when i am using word? the error message is "word is unable to save the Autorecover file in the location specified. Make sure that you have specified a valid location for Autoreover files in Preferences,-

    how can i stop an error message that comes up when i am using word? the error message is "word is unable to save the Autorecover file in the location specified. Make sure that you have specified a valid location for Autoreover files in Preferences,…"

    It sounds like if you open Preferences in Word there will be a place where you can specify where to store autorecover files. Right now it sounds like it's pointing to somewhere that doesn't exist.

  • Satellite A100-912: How can I obtain a Toshiba step by step upgrade DVD

    I bought a Satellite A100-912 (with XP installed). Now I'm upgrading to Vista Ultimate. I don't have the Toshiba Step By Step Upgrade DVD; so how can I obtain (or buy) a copy of the DVD?

    I bought the notebook after the date (15 Mar 2007) for redeeming the express upgrade DVD for Vista from Toshiba. In this regards, I bought an origiona OEM Windows Vista Ultimate to upgrade from XP. I want to install the Toshiba Softeware that was bundled with notebook and works with Vista and thats why I want the upgrade DVD...

  • How can I delete Skype SMS messages from my I-Pad?

    How can I delete Skype SMS messages from my I-Pad?

    This is a user-to-user forum. Everyone here is a volunteer. Sometimes it takes longer than two minutes to get answer. Additionally, it's a support forum for Apple products, not Skype. You might get lucky and get an answer, you might not. While you're waiting, why don't you try Skype support?
    https://support.skype.com/en/

  • How can I retrieve my old messages

    How can I retrieve my old messages for iPhone?

    This article may be helpful:
    How to Retrieve Deleted Text Messages on iPhone

  • How can i hide a tex message on my screen? i have a 4s?

    how can i hide a tex message on my screen when my phone is locked? i have the 4s

    Settings>Notifications>Messages>View in Lock Screen>OFF
    Message was edited by: The Huntress

  • How can we get a alert message in  the current browser we are using the mom

    how can we get a alert message in the current browser we are using the moment we have entered some data in
    the table...
    I need a popup alert the moment a new record is added in a table... in apex database is 11g xe..
    The idea is I am using a apex application. .The moment new data is added in the table ..I am alerted by a message window..that a new record has been added...
    Thanks
    Edited by: pauljohny on Jun 11, 2012 10:23 AM

    pauljohny wrote:
    how can we get a alert message in the current browser we are using the moment we have entered some data in the table...
    "Current browser"? When viewing anything, or just when using an APEX app?
    Ans .. Just when using apex app....even if the apex app is minimised ..The current browser will be the one where I am using apex app...
    What i am looking for some scheduler .. to check ..in the table every 5 minute for change if there is a change..then a popup alert be shown...
    Split it into [at least] 2 components, database and browser. I'd expect someone calling themself a "DBA Architect" to have some ideas about the database side of things, even if not clued up on JavaScript and AJAX?
    I dont think its a database isssue... When i say to check every 5 minutes ..it could be easily done via dbms_scheduler ...I am having issue in getting the popup alert message...
    in apex... Dont know wether there is a plugin like modal window(available from skill builder) which shall help in this scenario,.Or might be have to use java scripting and ajax ..
    and if it is that (Java scripting and Ajax) .....then shall have to be familiar with java scripting and Ajax...and this shall be a bit time consuming..
    Had a feeling this could be accomplished via java scripting and ajax.. ...but still looking for some easy way..

  • How can I add a new message(custom text message) to the holiday approval em

    How can I add a new message(custom text message) to the holiday approval email-notification sent to the manager?
    TIA

    The answer is 'not very easily', unless the information you want to display is the employee's leave balances. In 12.1.3 Oracle have delivered functionality that allows you to include the leave balances in the approval notifications out-the-box, ie, without customization.
    For any other information you're probably going to have to customize the standard delivered HRSSA workflow. Within this workflow, the Leave of Absence functionality uses the Notify Approver (Embedded) (HR_APPROVER_NTF) notification. The body of this notification is set to the Notify Approver (Embedded) (HR_NTF_EMBEDDED_REGION) attribute. This in turn defaults to:
    JSP:/OA_HTML/OA.jsp?OAFunc=-&HR_EMBEDDED_REGION-&NtfId=-&#NID-
    So essentially you can change the HR_APPROVER_NTF notification. The problem with changing this notification is that it's generic - it's used for all SSHR functions and not just Leave of Absence. That means you have to make other, more substantial, customizations to the workflow to ensure the changes you make only applies to LOA.
    The other option is to personalize the review page (ie, the region referenced in &HR_EMBEDDED_REGION) to include whatever messages you want. But that means they'll appear on the Review page and all LOA approval notifications and that might not be what you want.
    It's usually better to live with what Oracle deliver and find an alternative solution! What's the content of the message you want to include?

  • How can I print a text message conversation from my iPhone? Not using screenshots.

    How can I print a text message conversation from my iPhone? Not using screenshots. It's around 500 messages so screenshots is not a option.

    Yes, you can delete from iphone:
    http://manuals.info.apple.com/enUS/iPhone_iOS4_UserGuide.pdf
    It is covered in the manual.
    Page 172:
    "Delete a podcast: In the Podcasts list in iPod, swipe left or right over the podcast, then
    tap Delete. "

Maybe you are looking for

  • Samsung 27" monitor doesn't recognize my MacBook Pro

    Hi All....I bought a Samsung 27" monitor ( S27B350H ) last night to use with my MacBook Pro laptop.  I connected a HDMI cable from the monitor to the HDMI/DVI adapter then connected it to my MacBook Pro.  Monitor doesn't recognize my MacBook. Why? Th

  • My alert ding lost on imessages?

    My alert ding on imessage has recently stopped working on my ipad air. When I go to sounds/settings there is no category for imessages. How can I fix this please?

  • Assign roles to task based on condition

    Hi, How to assign portal role to task based on condition. If city = abc assign roleA, or else city = zyx assing roleB ie.. Appreciate your valuable suggestions. cheers -Ian

  • BC pop up alerts and shooping cart  strings

    Hi everyone, I am trying to make custum  alert messages in Portuguese on a BC website using this code from : Customizing Online Shop Alert Message Strings and also customize the online shop layout strings like "Shoping cart is empty! continue shoopin

  • DDL EXCLUDE ALL in GoldenGate

    Looks like this is a new feature but doesn't have enough documentation. Does anyone know what it really is for? What we want to do is not use GoldenGate for DDL replication in biderctional setup but do it manually in controlled fashion. In streams it