|
As far as RPG is concerned, NULL is not a field value, NULL is a field attribute like length, decimal positions and text. All fields require "valid" values, i.e. you cannot store the letter "A" in a numeric field and you cannot store the date 0000-00-00 in a date field. This requirement exists even if you set the NULL indicator, i.e. you cannot store the date 0000-00-00 in a date field just because the NULL indicator is set. There is some confusion on this issue because the ASCII character set defines x'00' to be the character named Null. As a convenient shorthand, programmers have been describing *LOVAL as being nulls, which is close enough for government work, but leads to confusion when talking about the NULL indicator in a database. I can set a character field to *LOVAL without setting it's NULL indicator. Likewise, I can set a character field's NULL indicator even though it contains a name like "BUCK CALABRO". In RPG, it is up to the programmer to test and set the NULL indicator separately from the field contents... SQL tables and DB2 files are essentially interchangeable as far as RPG is concerned. You can use SQL to CREATE TABLE that RPG can read, or you can use DDS to CRTPF that SQL can read. You can define null-capable fields either way. Buck Calabro Aptis; Albany, NY > -----Original Message----- > From: Jim Langston > Sent: Friday, December 17, 1999 12:41 PM > To: RPG400-L@midrange.com > Subject: Re: Urgent!!! NULLS & ZEROS > > I can think of a kludge that would work. Replace > all the NULLS with 0001-01-01 (which is *LOVAL > for *ISO dates which is what we use on our AS/400 to > be a NULL) and then import it. > > You would probably want to copy this to another file > first though so you don't get invalid dates in your SQL > database. > > Regards, > > Jim Langston > > Gade_R_Reddy@consecofinance.com wrote: > > > Hello everybody. > > > > Got a question about the field data types.. > > I have Nulls in integer fields and in date fields on the Sql server > > table. Now i need to export this data to AS400 physical file, but AS400 > > unfortunately doesn't accept the NULLS in integer fields and Zeros in > > the date fields. > > > > Any suggestions how do i go for it. > > > > Thanks Guys. > > > > Gade. +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
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.