× 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.



I am not interested in converting the null values into something else. For example I do not want to change from
Select thisvalue
To
Select ifnull(thisvalue, '')
Now that I have that out of the way let me explain the situation.

I am reading from a UDTF. I am trying to read into a data structure.
It is not an externally defined data structure.
This data structure has two null capable subfields. I added the two null indicator subfields to the end of the data structure.
This is now causing
DCL-DS Security_journal QUALIFIED;
entry_timestamp timestamp;
sequence_number packed(21 : 0);
system_sequence_number packed(21 : 0);
object_type varchar(10);
user_profile_changed varchar(10);
command_type char(3);
password_was_changed char(1);
no_password char(1);
password_expired char(1);
currently_allobj char(1);
currently_secadm char(1);
previously_allobj_je char(1);
previously_allobj_j5 char(1);
previously_secadm_je char(1);
previously_secadm_j5 char(1);
group_profile_je varchar(10);
group_profile_j5 varchar(10);
remote_address varchar(46) nullind(remote_address_nullind);
remote_port int(10) nullind(remote_port_nullind);
current_user varchar(10);
job_name varchar(10);
job_user varchar(10);
job_number varchar(6);
program_name varchar(10);
remote_address_nullind ind;
remote_port_nullind ind;
END-DS;
The select statement itself only selects 24 columns.
exec sql fetch c1 into :security_journal;
Selecting 24 columns into a data structure with 26 subfields results in
SQL0326 -
Message . . . . : Too many variables specified.
Cause . . . . . : 26 variables were specified on the FETCH, embedded SELECT,
SET, or VALUES INTO statement, but only 24 columns were returned from the
query. Extra global variables will not be changed. Extra host variables
will be filled with the appropriate value for the specified type:
SQLSTATE = 01557 Too many variables have been specified on SELECT INTO or FETCH.

Before I added the NULLIND and the additional columns I was getting errors when those two columns were null
SQLSTATE = 22002 A null value, or the absence of an indicator parameter was detected; for example, the null value cannot be assigned to a variable, because no indicator variable is specified.
SQL0305
Message . . . . : Indicator variable required.
Cause . . . . . : A FETCH, embedded SELECT, CALL, GET DESCRIPTOR, or a SET
or VALUES INTO statement has resulted in a null value, but an indicator
variable was not specified for host variable REMOTE_ADDRESS. The relative
position of the host variable in the INTO clause or parameter list is 18. If
the host variable name is *N, a descriptor area was specified.
If this error occurs on a GET DESCRIPTOR statement, the null value is
being returned but the INDICATOR item was not specified on the GET
DESCRIPTOR statement.
Recovery . . . : Specify an indicator variable, and precompile the program
again.


Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1
Group Dekko
Dept 1600
Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.