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



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,


I talked with Scott Forstie, at COMMON, several years ago, about this very
idea. What I wanted and asked for was something like:

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 new
target file, the one that looks the way you want it to look, then just do
the following:

#1. edit that source so that it now matches the name of the original table
(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
--
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 thread ...

Follow-Ups:
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.