We have a database table with a number of null capable fields - see
definition below:
CREATE TABLE JM_LIMS_INTERFACE (
OBJECT_ID INTEGER ,
OBJECT_TYPE VARCHAR (10) ,
INTERFACE_NAME VARCHAR (10) ,
POSTING_STATUS VARCHAR (1) ,
POSTING_DATE TIMESTAMP ,
POSTING_ERROR VARCHAR (40) ) ;
I have an ILE RPG prog which reads a record from the table with no
problems - field posting_status is set to null. Testing this using the if
%NULLIND(fieldname) function works ok and confirms the field is null !!
However any attempts to update this field while it contains the null value
results in a data mapping error which suggests that the field will not
accept null values ('field that is not null capable cannot be set to null'
error generated) - the basic logic is :
EVAL %NULLIND(POSTI00001) = *OFF
EVAL POSTI00001 = 'P'
UPDATE rformat
POSTI00001 is the field name for the alias name POSTING_STATUS
My control specification includes the ALWNULL(*USRCTL) keyword.
I have not used ILE RPG much, but need it to work with this table on the
400 - have I missed the plot somewhere ??? We're running V4R2 on our AS400.
Regards,
Steve Moxon
Mabye SF53747 <see cover letter> on C9180420 or its later PTF SF60897.
Regards, Chuck
All comments provided "as is" with no warranties of any kind whatsoever.
Barbara Morris
Steve Moxon wrote:
>
> I am having difficulty updating a null value field using an ILE RPG program
> and wonder if anyone can offer any suggestions.
> ...
> CREATE TABLE JM_LIMS_INTERFACE (
> ...
> POSTING_STATUS VARCHAR (1) ,
> ...
> However any attempts to update this field while it contains the null value
> results in a data mapping error which suggests that the field will not
> accept null values ('field that is not null capable cannot be set to null'
> ...
Thank you both for the responses. APAR SA78270 is an exact match for
my problem - I'll install the PTF ASAP.
Steve Moxon
Barbara Morris wrote in message <38A1CCD5...@ca.ibm.com>...