×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
You can define any result in COALESCE or IFNULL. You only need to ensure that the value you stick in there is compatible with the target data-type.
Ifnull(field1,1200)
will allow zero to remain a valid value...only NULLs (which is a LACK of a value) are changed into 1200.
Steve Needles
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Justin Taylor
Sent: Friday, May 09, 2014 1:14 PM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: RE: SQL null indicator variable in DS
COALESCE is often the best way to deal with nulls, but this column is numeric and a null must be treated differently than a zero. I guess I could convert it to character, translate the nulls to blanks and do some extra processing in my code. That would be a whole lot more work than just using a locally-defined null indicator field and moving that into the DS field. It's just a mystery why it won't allow the field defined in the DS to be the null indicator.
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
________________________________
This communication, including attachments, is confidential, may be subject to legal privileges, and is intended for the sole use of the addressee. Any use, duplication, disclosure or dissemination of this communication, other than by the addressee, is prohibited. If you have received this communication in error, please notify the sender immediately and delete or destroy this communication and all copies.
TRVDiscDefault::1201
As an Amazon Associate we earn from qualifying purchases.