Error handling in trigger
Posted in 2004
Topics: Stored Procedures & SPL, Triggers, Constraints & Referential Integrity
Hi, Does any one know how can i check status of insert/update statement in a trigger itself ( I want to raise a particular exception on fail of update in the trigger and i dont want to call a stored procedure for update/insert)? Thanks Preetinder
By calling the stored procedure you don't want to call? There isn't any other way of doing it. -- Jonathan Leffler (jleffler@us.ibm.com) STSM, Informix Database Engineering, IBM Data Management 4100 Bohannon Drive, Menlo Park, CA 94025 Tel: +1 650-926-6921 Tie-Line: 630-6921 "I don't suffer from insanity; I enjoy every minute of it!" forum.subscriber@iiug.org wrote on 03/14/2004 11:47:31 PM: > Hi, > > Does any one know how can i check status of insert/update statement > in a trigger itself ( I want to raise a particular exception on fail of > update in the trigger and i dont want to call a stored procedure for > update/insert)? > > Thanks > Preetinder > >
Look in SQL Syntax manual for sqlca or dbinfo. For instance, use dbinfo(sqlca.sqlerrd2) to get the number of rows processed.