473,698 Members | 2,300 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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.

Apr 25 '07 #1
3 5397
PaulR wrote:
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?
If you can route the app through a view you can use an INSTEAD OF TRIGGER
to selectively ditch rows...

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Apr 25 '07 #2
If exceptional rows are not so many,
how about DELETE unneccesary row?

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

It will be better to CREATE INDEX for performance.

Apr 26 '07 #3
Thanks for the ideas.

We'll give them a go!

Apr 27 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1792
by: Vijayaraghavan Kalyanapasupathy | last post by:
Hello All, I just learnt about smart pointers. Given the advantages of using smart-pointers, as a designer of say a List object, I can inhibit creation of the actual objects by making its constructors and then making the smart pointer a friend of the class (I am talking about a specific smart pointer implementation for a specific object). Now, it seems to me that inhibiting the use of "new" with the smart pointer would enhance things....
2
5176
by: Guy Eschemann | last post by:
When running the following code through splint, I get two warnings that I don't fully understand. This is the code : --- typedef struct { int *pData; } t_MyStruct;
19
3850
by: ccwork | last post by:
Hi all, I am reading "C: A Reference Manual" 4th ed and I get lost for the "extern". It says that global object without specifying the storage-class specifier will have "extern" as the default storage-class specifier. My (little) C experience tells me that an object with "extern" is to let the linker knows that the object is referencing the object defined in somewhere, and this "somewhere" object does not have the storage-class specifier...
44
4199
by: Tolga | last post by:
As far as I know, Perl is known as "there are many ways to do something" and Python is known as "there is only one way". Could you please explain this? How is this possible and is it *really* a good concept?
11
11168
by: Ron L | last post by:
I have a barcode scanner which uses a "keyboard wedge" program so that the data it scans comes through as if it was typed on a keyboard. I am trying to have the data in the barcode be displayed in a text box. I know that there are certain control characters embedded in the data that I want to display substitutions for in the text box, for instance I want to replace ASCII character 04 with the string "<EOT>". I have tried doing a simple...
0
8608
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9029
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8897
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6522
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.