Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to display and error message together (with variable) in a trigger?

Re: How to display and error message together (with variable) in a trigger?

From: kshirey <kshirey_at_hencie.com>
Date: Sun, 16 Aug 1998 11:46:49 -0500
Message-ID: <35D70CF9.AB8BDBDD@hencie.com>


Try using
  RAISE_APPLICATION_ERROR(-20001,'This room has already been booked by ' || variable_containing_name);

  The first parameter (you should stay in the 20000-29999 range) is your application's error code.
  The second parameter is the error message to be displayed.

Note that the RAISE_APPLICATION_ERROR will stop the execution of the program unit immediately.

Ken Shirey

kickerchua_at_audiophile.com wrote:

> hi all, i am building a trigger that will stop an insert.
>
> when the condition is met, i want it to display a line like:
>
> 'You cannot booked this room because it have been booked by ???'
>
> where ??? is and variable in the trigger.
>
> even though i can use "dbms_output.put_line" to do this but it will not show
> if i add "raise_application_error" to stop the insert.
>
> can anybody help me out, thank you very much.
> pls reply to me via email to choonkeng_at_yahoo.com
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
>
>
Received on Sun Aug 16 1998 - 11:46:49 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US