insert into filea (fld1, fld2, fld3, fld4, fld5)
select * from fileb where <...>

No, the default date value is usually CURRENT_DATE when dealing with SQL.
In any event, it can never be 00-00-000 as that is not a valid date. RPG
programs usually use 01-01-0001.

HTH,
CHarles


On Mon, Dec 17, 2012 at 4:20 PM, Keith McCully <keithmccully@xxxxxxxxx>wrote:

I have 2 files, FileA & FileB. FileA has 10 fields and FileB has 5 fields
but FileB's 5 fields are identical in name, type and size to the first 5
fields in fileA.

FileA is initially empty but must be populated from FileB that has around
10,000 records. FileA fields 1 to 5 will take their values from FileB but I
am okay with FileA fields 6 to 10 having default values according to type
since these re not required for this process.

I could do this with a small RPG program but I'm fairly sure that this
could be done using SQL and applying the default values for fields 6 to 10?
Perhaps using INSERT together with a sub-select from FileB plus inserting
default values according to type.

One of the fields is DATE type size 10. I thought the default for that was
00-00-0000?

Thanks,

Keith
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.