|
Use IfNull within the sql to replace nulls with a different value - for example blanks. Here's an example of what I mean. Select first_name,last_name,city,IfNull(state,' '),zipcode from custmast This will select the specified fields from every record in file custmast checking for nulls in the state field and converting them to blank. Hope that helps.... S. Ellsberry -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of jlowary@xxxxxxxxxxxxx Sent: Thursday, August 31, 2006 5:55 PM To: rpg400-l@xxxxxxxxxxxx Subject: When using a file that has (ALWNULL - Null Capable Field) getting"22002" in SQLRPG Has anyone ever done (or can it be done) had an SQLRPG program over a file that has fields that allow null values (I'm assuming they have the ALWNULL on them as the display of the field definition says they "Allow the Null Value")? We have a vendor file that uses a null capable field for a name field. If I do not include this field in the SQL mapping all is well, but if I put that field in then I get a SQLSTT = "22002" and no data for that record, all fields are blank/zero. I've not done a lot with SQLRPG and definitely not with Null Capable Fields, so I'm at a loss as where to even look for answers (if there are any other than, it can't be done). Thanks, Jim Lowary System Analyst, Salton Inc. (573) 447-5500 -- This is the RPG programming on the AS400 / 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.
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.