×
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.
Hi Bob,
Much as we in the RPG world have always handled them... In the case of a date
field, initialize to *loval (which results in '0001-01-01'). Where once we
tested our numeric date field for zero, we now test for *loval.
Really, this is not so very different from testing the null indicator, but note
that with the null indicator, you must ALWAYS check this flag before using the
returned value. By this, I mean that it is entirely valid for a field to be
null AND to return a valid value such as '2007-04-23'. In fact, the database
insists on a valid value for a date field, regardless of whether it is flagged
as null or not. Using null support requires a commitment to ALWAYS test the
null indicator before processing your logic.
hth,
Eric
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[
mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Bob Anderson
Sent: Monday, April 23, 2007 2:03 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: Question about SQL and Nulls
Eric,
Follow-up if not using Nulls what is the best way to handle Date
fields where you may not have a value for the field yet, as in a
revision date.
Thanks
Bob
IT Guy
As an Amazon Associate we earn from qualifying purchases.