|
> From: darren@xxxxxxxxx > > Joe wrote: > >>I guess it's a little more complicated when the NULLs come from missing > records in JOINs. If you have a default value for a NULL-capable column > in a file you are JOINing to and the record does not exist, do you get > the default value or NULL? > > I've not yet found or seen a solution to missing fields in an outer join > other than the IFNULL and COALESE (spelling?) function. I think it would > be a big help to have an option where the default value for the field is > returned, rather than NULL, which my standard RPG program don't handle too > well. Maybe IBM will add it someday.... It certainly seems to me that the NULL is overused. It's fine when needed, but when all you want is the value of a field if a record exists or a default value if it doesn't, then NULL isn't particularly elegant. Of course, you could write UDFs for every stinking field in your database, but calling a UDF is just as much work, if not more, than writing the IFNULL clause. I think the ability to define at a global level "USE_DEFAULT_FOR_NULL" would be a great concept. Joe
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.