null vs. empty string? (the same old story...), repost
Posted in 1999
[This is a repost. I believe not many people have read the original post over the pentecost holidays so that's why I'll give it another try. Thanks to Austin Castro for his reply to the original post] Sorry to bother you all again with the old "null vs. empty string" issue. I'm sure this has been discussed in this group over and over again but searching through the archives and other sources I can't find an answer to my particular problem: Informix handles an empty string and the null value differently, i.e. if I insert an empty string ('' or "") into a string field then that does not convert to null. This is fine with me as I would expect that behavior from any RDBMS. However, I now have to port an application from Oracle and SQL Base, both of which convert an empty string to null when inserting/updating, to Informix. This application makes intensive use of inserting an empty string but actually meaning to insert null. Is there any way to force Informix to adapt Oracle's behavior of interpreting an empty string as null? If not, are there any suggestions for workarounds? I have thought about writing triggers that would intercept inserts/updates of an empty string and instead insert/update null, but that seems kind of awkward (besides, I wouldn't even know how code such a trigger). Any help would be greatly appreciated. Cheers E.