Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Customize message on insert or update

Status
Not open for further replies.

evergrean100

Technical User
Dec 1, 2006
115
US
Anyway to create my own customized message after a insert or update in a Oracle 9i table?

Here is my trigger attempt:

Code:
DECLARE
city varchar2(100);
Begin
if city is null then
RAISE_APPLICATION_ERROR(-20000,'NO DATA ENTERED');
end if;
end;


This trigger did output a message on a blank insert attempt but also said I had invalid value in Trigger line 5. And it wouldnt allow any update to the city field which is not what I wanted. The update attempt froze up and nothing happened on my attempt.

I want a null value allowed for the city field and would like to have an output message or ora code number output if someone updates or inserts a null value in the city field.

I also tried dbms_ouitput.put_line('NO DATA ENTERED'); and it didnt output anything.
 
did you already try to issue the
SET SERVEROUTPUT ON command?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top