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



Oops!

sed 's/Charles/Chuck/g' < my_message > correction

Sorry, Chuck, that I called you by the wrong name!

Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
One of the reasons for the fall of the Roman empire was that, lacking zero,
they had no way to indicate normal termination of their C programs.
-- Robert Firth


When I saw Charles' response, I thought, "What a great idea! A command
to select all fields EXCEPT those named!" SO thanks for the idea,
Charles.

I have placed onto http://www.lovelady.com/misc a working
program/command called (for lack of a better name) SLTDROP that will
build exactly such an SQL statement. It doesn't do anything with it,
but it does build the statement, and in debug it could be captured, or
it could be written, displayed, folded, stapled and mutilated 'till
your heart's content.

Command execution might look like:
SLTDROP TABLE(the_master) SKIPCOL(col3, col17, empnum, cost)

It would be so easy to add OUTPUT(...) or whatever.

Enjoy. Or not.

Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"If I were two-faced, would I be wearing this one?"
-- Abraham Lincoln


On 02-Jul-2010 00:36, David FOXWELL wrote:

After running a test procedure, I found the results of the
program comparing the test results with the previous test very
difficult to read. The output file being compared contains
various dates in different formats. My modification changed
nearly all these dates among other things, so I ended up having
to read a very large spool file as all the test cases were
affected.

I tried select fld1, fld2, etc from testfile union select fld1,
fld2, etc from savedtestfile, ignoring the different date fields.
The test cases having 2 lines in this select were those I
wanted.

As the file in the select has a lot of zones, the sql wasn't easy
to code. I had to select all fields, then find those I didn't
want, delete them from the statement and copy the first half of
the statement to the second half.

Eg, select fld1, fld2, ....fld100, from testfile

delete fld3, fld74, etc from statement.


Could I achieve this any easier?


Unfortunately SQL does not have an OMIT column list to correlate
to a column list of name.* on the select-clause; i.e. as a request
to include all columns, there is no ability to exclude columns with
any subclauses such as in the following pseudo-SQL SELECT statement
using a non-existent OMIT clause as a subclause of the SELECT-clause:

SELECT RRN(A) AS R,A.* OMIT A.F3, A.F74 FROM TESTFILE AS A

One option would be to duplicate each file with data to another
file, then ALTER TABLE EachDuplicate DROP COLUMN FLD3 DROP COLUMN
FLD74 or possibly since v6r1 to issue ALTER TABLE on each, to ALTER
COLUMN on FLD3 and FLD74 to make those columns IMPLICITLY HIDDEN
such that the asterisk as the SELECT list notation would exclude
those columns.

http://publib.boulder.ibm.com/infocenter/iseries/v6r1m0/topic/db2/rbafz
selectnotation.htm

FWiW any good prompted SQL interface should probably have a
manner to easily effect "select all" of the columns [seems not so
with STRSQL, which also means STRQM; i.e. no F21=select all from the
"select and sequence fields" panel]. The resultant statement should
then be able to be copied\pasted or saved to a file. Also note that
a recursive query of the SQL catalog [syscolumns or equivalent] or
of a DSPFFD output file should be able to generate a column list [I
have posted an example here in the past] in a report as a varchar
one-line result. Similarly, but as a line per column, the following
query can easily produce a select list of all columns:

<code>

select
case colno when 1 then ' ' else ',' end concat sys_cname
from qsys2/syscolumns /* or modify & use DSPFFD OutFile */
where sys_tname='TESTFILE' and sys_dname='TheLibName'
/* and sys_cname not in ('FLD3', 'FLD74') */
order by colno

So for QCUSTCDT in QIWS, the result of the above query:

....+....1....+..
String Expression
CUSNUM
,LSTNAM
,INIT
,STREET
,CITY
,STATE
,ZIPCOD
,CDTLMT
,CHGCOD
,BALDUE
,CDTDUE
******** End of data ***

</code>

Regards, Chuck
--
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.