Help : Trigger error, Please

From: Laurent <L.Phelep_at_ex.ac.uk>
Date: 1998/04/30
Message-ID: <3548A52C.41C6_at_ex.ac.uk>#1/1


Hi,

I received these errors messages when I run the following trigger :

create trigger contract_1
before insert on contract
for each row
declare

	two_contract_error	exception;
	test 			number;
begin
	select count(contract_no) 
		into test
		from contract 
		where (cust_no = :new.cust_no and 
			Real_date_in is NULL);
	if (test <> 0) then
		raise two_contract_error;
	end if;
	exception
	when two_contract_error then 
		raise_application_error(-20671, 'This client already has a car
		on loan, rental refused');

end;
/

I do receive the following errors :

 SQL> _at_ test2;
insert into contract values(

            *
ERROR at line 1:
ORA-20671: This client already has a car on loan, rental refused
ORA-06512: at "OPS$CS95LP.CONTRACT_1", line 15 ORA-04088: error during execution of trigger 'OPS$CS95LP.CONTRACT_1'

SQL> I do understand the first one but not
the number 06512 and 04088

In the book i only have this help :

--ORA-06512 at str line num

 Cause:

       This is usually the last of a message stack and indicates where a problem occurred in

       the PL/SQL code.

 Action:

        Fix the problem causing the exception or write an exception handler for this condition.

        It may be necessary to contact the application or database administrator.

Please help, itis very urgent

Thanks

Laurent

p.s. : thanks to answer to both newsgroup and email....  

Laurent PHELEP                                                   /\
Third Year Student in Computer Science                           \/
University of Exeter                                           <>  <>
Email : L.Phelep_at_ex.ac.uk                                        /\
http://www.dcs.exeter.ac.uk/ug/cs95/lp/                         /  \
                                                               /    \
Kenavo                                                        / /\/\ \
Received on Thu Apr 30 1998 - 00:00:00 CEST

Original text of this message