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



Not really... but if this is a common issue, you may want to create couple
of views that list the fields you want or not. Then specify the views in
the INSERT.
Just a thought.

Celebrating 10-Years of SQL Performance Excellence
http://centerfieldtechnology.com/training.asp

-----Original Message-----
Subject: SQL INSERT with unequal fields

I needed to make a change to an RPG program that creates a work file with
selected records from 2 other files.

Since SQL works with sets of records, I thought this would be ideal for SQL.

The 2 other files have dissimilar formats. The 1st has 2 fields that don't
exist in the 2nd, and vice versa. The work file format matches the format
from the 1st file, but not the 2nd. The SQL to insert records from the 1st
other file works fine, but, obviously, the following SQL insert won't work
for the 2nd file:

Insert into QTEMP/DKOPNAPD
Select * From DBMSTF/APHIST
Where ACREC = 'A' and
RECDT <= '2007-07-31' and
CMPNO IN (01,02)

because of the dissimilar formats. The fields that are dissimilar are not
important to the reports that will be genned from this workfile, so I don't
really care what goes in there. Is there a way to tell SQL to use the
fields from a particular file here without naming all the fields?

Thanks.


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.