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