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