|
Charles,
Depending on whether fields / columns are made smaller or removed, you
will also need to worry about ensuring that message ID CPA32B2 is answered
"I" automatically.
We did it by temporarily changing the job to be INQMSGRPY(*DFT) and
overriding the QCPFMSG message file to a special one with that message
changed to have its default to be "I".
Regards,
Kevin Wright
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of
Charles Wilt
Sent: Thursday, 17 October 2019 6:46 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: Utility to compare structure of two tables and generate an
ALTER TABLE
I'd forgotten about the OR REPLACE with DATA on the create table...
That might do the trick..
Actually the two tables in question are the same table, just one is a
newer
version.
I'm looking at something better than having developers script the ALTER
TABLE..
Charles
On Wed, Oct 16, 2019 at 12:40 PM Mark Waterbury <
mark.s.waterbury@xxxxxxxxxxxxx> wrote:
Hi, Charles,very
I talked with Scott Forstie, at COMMON, several years ago, about this
idea. What I wanted and asked for was something like:new
ALTER TABLE ... LIKE some other table
similar to what ORACLE and several other database have done. ;-)
When I talked to Scott forstie about it, he then told me about the
then-new feature of Db2i SQL where you can now do:
CREATE OR REPLACE TABLE (or VIEW etc.) ... WITH DATA.
So, what you could do is retrieve the SQL DDL using that API, or one of
those newfangled "services" (UDTFs, or UDFs, see Rob's reply), for the
target file, the one that looks the way you want it to look, then justdo
the following:table
#1. edit that source so that it now matches the name of the original
(library/filename) you want to CREATE OR REPLACE--
#2. insert the "OR REPLACE" into that generated CREATE statement
#3. add the appropriate "WITH DATA" clause on the end
#4. save it
#5. run it using iACS or RUNSQLSTM etc.
"and Bob's your uncle!"
What do you think? :-)
All the best,
Mark S. Waterbury
On Wednesday, October 16, 2019, 1:41:48 PM EDT, Charles Wilt <
charles.wilt@xxxxxxxxx> wrote:
Anybody ever run across a utility that would compare two tables and
generate the necessary ALTER TABLE command to make the second table look
like the first?
Basically, looking for the SQL equivalent of CHGPF SRCFILE()...
Thanks!
Charles
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.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.