- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Informix trigger statement
Operating System - HP-UX
1824007
Members
3592
Online
109667
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-09-2001 12:53 AM
тАО10-09-2001 12:53 AM
Hi,
Does anyone know the informix trigger statement ? I have the following example
When inserting a table, if I encounter a field, say 'name', is a NULL value then the trigger statement should insert the table with the column a constant value "ABCDE" instead of NULL !
My HP-UX is 11.0 and Informix 7.31.UC6A !
Best Regards,
Patrick
Does anyone know the informix trigger statement ? I have the following example
When inserting a table, if I encounter a field, say 'name', is a NULL value then the trigger statement should insert the table with the column a constant value "ABCDE" instead of NULL !
My HP-UX is 11.0 and Informix 7.31.UC6A !
Best Regards,
Patrick
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2001 04:16 AM
тАО10-10-2001 04:16 AM
Re: Informix trigger statement
No, this is not my forte....but I did find an interesting page that gave some examples from an Informix Users Group that may help you. Look past the intro...Here's the thread:
http://www.iiug.org/~waiug/old/iugnew44.htm
Regards,
Rita
http://www.iiug.org/~waiug/old/iugnew44.htm
Regards,
Rita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2001 07:52 PM
тАО11-04-2001 07:52 PM
Solution
Hi,
I've only seen Triggers on insert used to cause an action on a different table; not update the same table as you want.
If you are doing the insert through an ESQL programme, you can add the logic for replacing nulls with your default value in the code before the insert.
Ditto for a shell script.
I'm not sure why you want to use a trigger, but if you can live without it, you can do what you are trying to do with a Stored Procedure.
Create a stored procedure say myval2insert(fieldname). This prodeure will return "ABCDE" if fieldname is NULL, or else fieldname itself.
Your insert statement would then be "INSERT into table myval2insert(fieldname)..."
Another option you may want to consider is to allow the database to hold NULLs, but while querying the table, do a
"SELECT nvl(field_name, \"ABCDE\") FROM table...".
This will return ABCDE if field_name is NULL.
For more info on triggers in Informix, see the SQL syntax guide for your Informix Engine at http://www.informix.com/answers/
HTH,
Deepak.
I've only seen Triggers on insert used to cause an action on a different table; not update the same table as you want.
If you are doing the insert through an ESQL programme, you can add the logic for replacing nulls with your default value in the code before the insert.
Ditto for a shell script.
I'm not sure why you want to use a trigger, but if you can live without it, you can do what you are trying to do with a Stored Procedure.
Create a stored procedure say myval2insert(fieldname). This prodeure will return "ABCDE" if fieldname is NULL, or else fieldname itself.
Your insert statement would then be "INSERT into table myval2insert(fieldname)..."
Another option you may want to consider is to allow the database to hold NULLs, but while querying the table, do a
"SELECT nvl(field_name, \"ABCDE\") FROM table...".
This will return ABCDE if field_name is NULL.
For more info on triggers in Informix, see the SQL syntax guide for your Informix Engine at http://www.informix.com/answers/
HTH,
Deepak.

The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP