Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / April 2007

Tip: Looking for answers? Try searching our database.

Trigger to "inhibit" Insert without gving error back to the calling statement?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
PaulR - 25 Apr 2007 15:05 GMT
Hi,

DB2 LUW 8.2

We would like to implement a trigger to stop an insert or "empty
row" (under certain conditions), but not to throw an exception back to
calling application i.e the calling application would be unaware that
the insert had been stopped.

Sounds a bit crazy perhaps, but is it possible?

Thanks.
Serge Rielau - 25 Apr 2007 18:16 GMT
> Hi,
>
[quoted text clipped - 6 lines]
>
> Sounds a bit crazy perhaps, but is it possible?
If you can route the app through a view you can use an INSTEAD OF TRIGGER
to selectively ditch rows...

Cheers
Serge

Signature

Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

Tonkuma - 26 Apr 2007 09:12 GMT
If exceptional rows are not so many,
how about DELETE unneccesary row?

CREATE TRIGGER Delete_Blank_ISRT
AFTER INSERT ON Inhibit_Blank_ISRT
REFERENCING NEW AS N
FOR EACH ROW
WHEN ( N.col1 = '' AND N.col2 = '' )
DELETE FROM Inhibit_Blank_ISRT
WHERE col1 = '' AND col2 = '';

It will be better to CREATE INDEX for performance.
PaulReddin - 27 Apr 2007 12:27 GMT
Thanks for the ideas.

We'll give them a go!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.